diff --git a/cpp/ql/lib/change-notes/2023-05-22-inline-in-std-namespace.md b/cpp/ql/lib/change-notes/2023-05-22-inline-in-std-namespace.md new file mode 100644 index 00000000000..8b562bd8357 --- /dev/null +++ b/cpp/ql/lib/change-notes/2023-05-22-inline-in-std-namespace.md @@ -0,0 +1,4 @@ +--- +category: minorAnalysis +--- +* The `StdNamespace` class now also includes all inline namespaces that are children of `std` namespace. diff --git a/cpp/ql/lib/semmle/code/cpp/Namespace.qll b/cpp/ql/lib/semmle/code/cpp/Namespace.qll index 129e1449c32..065e28c8429 100644 --- a/cpp/ql/lib/semmle/code/cpp/Namespace.qll +++ b/cpp/ql/lib/semmle/code/cpp/Namespace.qll @@ -230,8 +230,12 @@ class GlobalNamespace extends Namespace { } /** - * The C++ `std::` namespace. + * The C++ `std::` namespace and its inline namespaces. */ class StdNamespace extends Namespace { - StdNamespace() { this.hasName("std") and this.getParentNamespace() instanceof GlobalNamespace } + StdNamespace() { + this.hasName("std") and this.getParentNamespace() instanceof GlobalNamespace + or + this.isInline() and this.getParentNamespace() instanceof StdNamespace + } }