Skip to content

Commit 21367f9

Browse files
committed
C++: Add overlay support for discarding namespaces
1 parent 1e14342 commit 21367f9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cpp/ql/lib/semmle/code/cpp/internal/Overlay.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ private string getSingleLocationFilePath(@element e) {
2929
or
3030
// @type_decl has a direct location in the type_decls relation
3131
type_decls(e, _, loc)
32+
or
33+
// @namespace_decl has a direct location in the namespace_decls relation
34+
namespace_decls(e, _, loc, _)
3235
|
3336
result = getLocationFilePath(loc)
3437
)
@@ -48,6 +51,9 @@ private string getMultiLocationFilePath(@element e) {
4851
or
4952
// @usertype gets its location(s) from its @type_decl(s)
5053
exists(@type_decl td | type_decls(td, e, loc))
54+
or
55+
// @namespace gets its location(s) from its @namespace_decl(s)
56+
exists(@namespace_decl nd | namespace_decls(nd, e, loc, _))
5157
|
5258
result = getLocationFilePath(loc)
5359
)

0 commit comments

Comments
 (0)