File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
src/Best Practices/Likely Errors
test/query-tests/Best Practices/Likely Errors/CommaBeforeMisleadingIndentation Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ import semmle.code.cpp.commons.Exclusions
13
13
14
14
/** Gets the sub-expression of 'e' with the earliest-starting Location */
15
15
Expr normalizeExpr ( Expr e ) {
16
- if forex ( Expr q | q = e .( Call ) .getQualifier ( ) | not q instanceof ThisExpr )
16
+ if forex ( Expr q | q = e .( Call ) .getQualifier ( ) | not q . ( ThisExpr ) . isCompilerGenerated ( ) )
17
17
then result = normalizeExpr ( e .( Call ) .getQualifier ( ) )
18
18
else
19
- if forex ( Expr q | q = e .( FieldAccess ) .getQualifier ( ) | not q instanceof ThisExpr )
19
+ if forex ( Expr q | q = e .( FieldAccess ) .getQualifier ( ) | not q . ( ThisExpr ) . isCompilerGenerated ( ) )
20
20
then result = normalizeExpr ( e .( FieldAccess ) .getQualifier ( ) )
21
21
else
22
22
if e .hasExplicitConversion ( )
Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ int Foo::test(int (*baz)(int))
40
40
(void )i, // GOOD
41
41
(void )j;
42
42
43
+ if (i)
44
+ this ->foo (i), // GOOD
45
+ foo (i);
46
+
43
47
if (i)
44
48
(void )i, // BAD
45
49
(void )j;
You can’t perform that action at this time.
0 commit comments