@@ -9,6 +9,8 @@ import semmle.code.cpp.File
99 * A location of a C/C++ artifact.
1010 */
1111class Location extends @location {
12+ Location ( ) { not files ( this , "" ) }
13+
1214 /** Gets the container corresponding to this location. */
1315 pragma [ nomagic]
1416 Container getContainer ( ) { this .fullLocationInfo ( result , _, _, _, _) }
@@ -53,9 +55,20 @@ class Location extends @location {
5355 predicate fullLocationInfo (
5456 Container container , int startline , int startcolumn , int endline , int endcolumn
5557 ) {
56- locations_default ( this , unresolveElement ( container ) , startline , startcolumn , endline , endcolumn ) or
57- locations_expr ( this , unresolveElement ( container ) , startline , startcolumn , endline , endcolumn ) or
58+ locations_default ( this , unresolveElement ( container ) , startline , startcolumn , endline , endcolumn )
59+ or
60+ locations_expr ( this , unresolveElement ( container ) , startline , startcolumn , endline , endcolumn )
61+ or
5862 locations_stmt ( this , unresolveElement ( container ) , startline , startcolumn , endline , endcolumn )
63+ or
64+ exists ( @container c , string name | files ( c , name ) or folders ( c , name ) |
65+ container = c and
66+ this = c and
67+ startline = 0 and
68+ startcolumn = 0 and
69+ endline = 0 and
70+ endcolumn = 0
71+ )
5972 }
6073
6174 /**
0 commit comments