File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
cpp/ql/src/semmle/code/cpp Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ private newtype TPrintASTNode =
9191 TDeclarationEntryNode ( DeclStmt stmt , DeclarationEntry entry ) {
9292 // We create a unique node for each pair of (stmt, entry), to avoid having one node with
9393 // multiple parents due to extractor bug CPP-413.
94- stmt .getADeclarationEntry ( ) = entry
94+ stmt .getADeclarationEntry ( ) = entry and
95+ shouldPrintFunction ( stmt .getEnclosingFunction ( ) )
9596 } or
9697 TParametersNode ( Function func ) { shouldPrintFunction ( func ) } or
9798 TConstructorInitializersNode ( Constructor ctor ) {
@@ -236,9 +237,11 @@ class PrintASTNode extends TPrintASTNode {
236237
237238private class PrintableElementBase extends ElementBase {
238239 PrintableElementBase ( ) {
239- not this instanceof Locatable
240+ shouldPrintFunction ( getEnclosingFunction ( this ) )
240241 or
241- shouldPrintFunction ( getEnclosingFunction ( this .( Locatable ) ) )
242+ this instanceof Type
243+ or
244+ shouldPrintFunction ( this .( DeclarationEntry ) .getEnclosingElement + ( ) )
242245 }
243246
244247 pragma [ noinline]
You can’t perform that action at this time.
0 commit comments