mirror of
https://github.com/github/codeql.git
synced 2026-03-06 15:49:08 +01:00
31 lines
694 B
XML
31 lines
694 B
XML
<!DOCTYPE qhelp PUBLIC
|
|
"-//Semmle//qhelp//EN"
|
|
"qhelp.dtd">
|
|
<qhelp>
|
|
|
|
|
|
<overview>
|
|
<p>This rule finds declarations of local variables that hide a local variable from a surrounding scope. Such declarations
|
|
create variables with the same name but different scopes. This makes it difficult to know which variable is actually
|
|
used in an expression.</p>
|
|
|
|
</overview>
|
|
<recommendation>
|
|
<p>Consider changing the name of either variable to keep them distinct.</p>
|
|
|
|
</recommendation>
|
|
<example>
|
|
<sample src="DeclarationHidesVariable.cpp" />
|
|
|
|
|
|
</example>
|
|
<references>
|
|
|
|
<li>
|
|
B. Stroustrup. <em>The C++ Programming Language Special Edition</em> p 82. Addison Wesley. 2000.
|
|
</li>
|
|
|
|
|
|
</references>
|
|
</qhelp>
|