mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
Update C++ variable hiding test
Structured bindings are now handled better, so the false negative related to structured bindings is now a true positive.
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
| 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:38:11:38:11 | x | Variable x hides another variable of the same name (on $@). | hiding.cpp:36:9:36:9 | x | line 36 |
|
||||
|
||||
@@ -35,7 +35,7 @@ void structuredBinding() {
|
||||
int xs[1] = {1};
|
||||
auto [x] = xs;
|
||||
{
|
||||
auto [x] = xs; // BAD [NOT DETECTED]
|
||||
auto [x] = xs; // BAD
|
||||
auto [y] = xs; // GOOD
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user