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) {
42
42
then result = e .getParentScope ( )
43
43
else (
44
44
// 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
+ )
46
55
)
47
56
}
48
57
Original file line number Diff line number Diff line change 8
8
| test.cpp:65:11:65:11 | i | Variable is hiding variable $@. | test.cpp:61:7:61:7 | i | i |
9
9
| test.cpp:67:9:67:9 | i | Variable is hiding variable $@. | test.cpp:61:7:61:7 | i | i |
10
10
| 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() {
72
72
73
73
try {
74
74
75
- } catch (int i) { // NON_COMPLIANT[FALSE_NEGATIVE]
75
+ } catch (int i) { // NON_COMPLIANT
76
76
}
77
77
}
You can’t perform that action at this time.
0 commit comments