File tree Expand file tree Collapse file tree
src/Best Practices/Likely Errors
test/query-tests/Best Practices/Likely Errors/CommaBeforeMisleadingIndentation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ import semmle.code.cpp.commons.Exclusions
1313
1414/** Gets the sub-expression of 'e' with the earliest-starting Location */
1515Expr 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 ( ) )
1717 then result = normalizeExpr ( e .( Call ) .getQualifier ( ) )
1818 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 ( ) )
2020 then result = normalizeExpr ( e .( FieldAccess ) .getQualifier ( ) )
2121 else
2222 if e .hasExplicitConversion ( )
Original file line number Diff line number Diff line change @@ -40,6 +40,10 @@ int Foo::test(int (*baz)(int))
4040 (void )i, // GOOD
4141 (void )j;
4242
43+ if (i)
44+ this ->foo (i), // GOOD
45+ foo (i);
46+
4347 if (i)
4448 (void )i, // BAD
4549 (void )j;
You can’t perform that action at this time.
0 commit comments