C++: Simplify cpp/declaration-hides-variable

The check for `(unnamed local variable)` is no longer needed, because these
variables are now identified as being compiler generated.
This commit is contained in:
Jeroen Ketema
2022-02-22 23:00:48 +01:00
parent b6b93065ff
commit 423d325204

View File

@@ -18,7 +18,6 @@ where
not lv1.isCompilerGenerated() and
not lv2.isCompilerGenerated() and
not lv1.getParentScope().(BlockStmt).isInMacroExpansion() and
not lv2.getParentScope().(BlockStmt).isInMacroExpansion() and
not lv1.getName() = "(unnamed local variable)"
not lv2.getParentScope().(BlockStmt).isInMacroExpansion()
select lv1, "Variable " + lv1.getName() + " hides another variable of the same name (on $@).", lv2,
"line " + lv2.getLocation().getStartLine().toString()