mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
C++: Fix DeclarationHidesVariable FP
We don't want alerts about the compiler-generated variables that appear in the desugaring of range-based `for`.
This commit is contained in:
@@ -1,5 +1,2 @@
|
||||
| hiding.cpp:6:17:6:17 | i | Variable i hides another variable of the same name (on $@). | hiding.cpp:4:13:4:13 | i | line 4 |
|
||||
| hiding.cpp:18:15:18:15 | k | Variable k hides another variable of the same name (on $@). | hiding.cpp:15:11:15:11 | k | line 15 |
|
||||
| hiding.cpp:30:5:30:5 | (__begin) | Variable (__begin) hides another variable of the same name (on $@). | hiding.cpp:29:3:29:3 | (__begin) | line 29 |
|
||||
| hiding.cpp:30:5:30:5 | (__end) | Variable (__end) hides another variable of the same name (on $@). | hiding.cpp:29:3:29:3 | (__end) | line 29 |
|
||||
| hiding.cpp:30:5:30:5 | (__range) | Variable (__range) hides another variable of the same name (on $@). | hiding.cpp:29:3:29:3 | (__range) | line 29 |
|
||||
|
||||
@@ -27,6 +27,6 @@ namespace foo {
|
||||
void nestedRangeBasedFor() {
|
||||
int xs[4], ys[4];
|
||||
for (auto x : xs)
|
||||
for (auto y : ys) // GOOD [FALSE POSITIVE]
|
||||
for (auto y : ys) // GOOD
|
||||
x = y = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user