Skip to content

Commit d40a12f

Browse files
committed
C++: Add overlay support for discarding user types
1 parent f746c65 commit d40a12f

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
@@ -26,6 +26,9 @@ private string getSingleLocationFilePath(@element e) {
2626
or
2727
// @fun_decl has a direct location in the fun_decls relation
2828
fun_decls(e, _, _, _, loc)
29+
or
30+
// @type_decl has a direct location in the type_decls relation
31+
type_decls(e, _, loc)
2932
|
3033
result = getLocationFilePath(loc)
3134
)
@@ -42,6 +45,9 @@ private string getMultiLocationFilePath(@element e) {
4245
or
4346
// @function gets its location(s) from its @fun_decl(s)
4447
exists(@fun_decl fd | fun_decls(fd, e, _, _, loc))
48+
or
49+
// @usertype gets its location(s) from its @type_decl(s)
50+
exists(@type_decl td | type_decls(td, e, loc))
4551
|
4652
result = getLocationFilePath(loc)
4753
)

0 commit comments

Comments
 (0)