@@ -19,26 +19,28 @@ import codingstandards.cpp.autosar
1919class UniqueLineStmt extends Locatable {
2020 UniqueLineStmt ( ) {
2121 not isAffectedByMacro ( ) and
22- ( exists ( Declaration d |
23- this = d .getADeclarationEntry ( ) and
24- not d instanceof Parameter and
25- not d instanceof TemplateParameter and
26- // TODO - Needs to be enhanced to solve issues with
27- // templated inner classes.
28- not d instanceof Function and
29- not d .isFromTemplateInstantiation ( _) and
30- not d .( Variable ) .isCompilerGenerated ( ) and
31- not exists ( RangeBasedForStmt f | f .getADeclaration ( ) = d ) and
32- not exists ( DeclStmt declStmt , ForStmt f |
33- f .getInitialization ( ) = declStmt and
34- declStmt .getADeclaration ( ) = d
35- ) and
36- not exists ( LambdaCapture lc | lc .getField ( ) .getADeclarationEntry ( ) = this )
22+ (
23+ exists ( Declaration d |
24+ this = d .getADeclarationEntry ( ) and
25+ not d instanceof Parameter and
26+ not d instanceof TemplateParameter and
27+ // TODO - Needs to be enhanced to solve issues with
28+ // templated inner classes.
29+ not d instanceof Function and
30+ not d .isFromTemplateInstantiation ( _) and
31+ not d .( Variable ) .isCompilerGenerated ( ) and
32+ not exists ( RangeBasedForStmt f | f .getADeclaration ( ) = d ) and
33+ not exists ( DeclStmt declStmt , ForStmt f |
34+ f .getInitialization ( ) = declStmt and
35+ declStmt .getADeclaration ( ) = d
36+ ) and
37+ not exists ( LambdaCapture lc | lc .getField ( ) .getADeclarationEntry ( ) = this )
38+ )
39+ or
40+ this instanceof ExprStmt and
41+ not exists ( ForStmt f | f .getInitialization ( ) .getAChild * ( ) = this ) and
42+ not exists ( LambdaExpression l | l .getLambdaFunction ( ) .getBlock ( ) .getAChild * ( ) = this )
3743 )
38- or
39- this instanceof ExprStmt and
40- not exists ( ForStmt f | f .getInitialization ( ) .getAChild * ( ) = this ) and
41- not exists ( LambdaExpression l | l .getLambdaFunction ( ) .getBlock ( ) .getAChild * ( ) = this ) )
4244 }
4345}
4446
0 commit comments