Skip to content

Commit a319fc0

Browse files
authored
Merge pull request github#13234 from jketema/std-inline
C++: Include inline namespaces in `StdNamespace`
2 parents 97b0012 + f31ab3a commit a319fc0

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
category: minorAnalysis
3+
---
4+
* The `StdNamespace` class now also includes all inline namespaces that are children of `std` namespace.

cpp/ql/lib/semmle/code/cpp/Namespace.qll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,12 @@ class GlobalNamespace extends Namespace {
230230
}
231231

232232
/**
233-
* The C++ `std::` namespace.
233+
* The C++ `std::` namespace and its inline namespaces.
234234
*/
235235
class StdNamespace extends Namespace {
236-
StdNamespace() { this.hasName("std") and this.getParentNamespace() instanceof GlobalNamespace }
236+
StdNamespace() {
237+
this.hasName("std") and this.getParentNamespace() instanceof GlobalNamespace
238+
or
239+
this.isInline() and this.getParentNamespace() instanceof StdNamespace
240+
}
237241
}

0 commit comments

Comments
 (0)