File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
test/rules/identifierhidden Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,16 @@ private Element getParentScope(Element e) {
4242 then result = e .getParentScope ( )
4343 else (
4444 // Statements do no have a parent scope, so return the enclosing block.
45- result = e .( Stmt ) .getEnclosingBlock ( ) or result = e .( Expr ) .getEnclosingBlock ( )
45+ result = e .( Stmt ) .getEnclosingBlock ( )
46+ or
47+ result = e .( Expr ) .getEnclosingBlock ( )
48+ or
49+ // Catch block parameters don't have an enclosing scope, so attach them to the
50+ // the block itself
51+ exists ( CatchBlock cb |
52+ e = cb .getParameter ( ) and
53+ result = cb
54+ )
4655 )
4756}
4857
Original file line number Diff line number Diff line change 88| test.cpp:65:11:65:11 | i | Variable is hiding variable $@. | test.cpp:61:7:61:7 | i | i |
99| test.cpp:67:9:67:9 | i | Variable is hiding variable $@. | test.cpp:61:7:61:7 | i | i |
1010| test.cpp:70:12:70:12 | i | Variable is hiding variable $@. | test.cpp:61:7:61:7 | i | i |
11+ | test.cpp:75:16:75:16 | i | Variable is hiding variable $@. | test.cpp:61:7:61:7 | i | i |
Original file line number Diff line number Diff line change @@ -72,6 +72,6 @@ void test_scope_order() {
7272
7373 try {
7474
75- } catch (int i) { // NON_COMPLIANT[FALSE_NEGATIVE]
75+ } catch (int i) { // NON_COMPLIANT
7676 }
7777}
You can’t perform that action at this time.
0 commit comments