File tree Expand file tree Collapse file tree
cpp/ql/lib/semmle/code/cpp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,10 +109,7 @@ class Element extends ElementBase {
109109 then
110110 exists ( MacroInvocation mi |
111111 this = mi .getAGeneratedElement ( ) and
112- not exists ( MacroInvocation closer |
113- this = closer .getAGeneratedElement ( ) and
114- mi = closer .getParentInvocation + ( )
115- ) and
112+ not hasCloserMacroInvocation ( this , mi ) and
116113 result = mi .getMacro ( )
117114 )
118115 else result = this
@@ -236,6 +233,14 @@ class Element extends ElementBase {
236233 }
237234}
238235
236+ pragma [ noinline]
237+ private predicate hasCloserMacroInvocation ( Element elem , MacroInvocation mi ) {
238+ exists ( MacroInvocation closer |
239+ elem = closer .getAGeneratedElement ( ) and
240+ mi = closer .getParentInvocation ( )
241+ )
242+ }
243+
239244private predicate isFromTemplateInstantiationRec ( Element e , Element instantiation ) {
240245 instantiation .( Function ) .isConstructedFrom ( _) and
241246 e = instantiation
You can’t perform that action at this time.
0 commit comments