[all-commits] [llvm/llvm-project] c60921: [clang] Fix isInStdNamespace for Decl flagged exte...
Fred Tingaud via All-commits
all-commits at lists.llvm.org
Thu Feb 15 05:55:37 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: c609211d912dfa9849c5ca873d40d10e32e0a975
https://github.com/llvm/llvm-project/commit/c609211d912dfa9849c5ca873d40d10e32e0a975
Author: Fred Tingaud <95592999+frederic-tingaud-sonarsource at users.noreply.github.com>
Date: 2024-02-15 (Thu, 15 Feb 2024)
Changed paths:
M clang/docs/ReleaseNotes.rst
M clang/lib/AST/DeclBase.cpp
M clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
Log Message:
-----------
[clang] Fix isInStdNamespace for Decl flagged extern c++ (#81776)
The MSVC STL implementation declares multiple classes using:
```cpp
namespace std {
extern "C++" class locale {
...
};
}
```
`isInStdNamespace` uses the first DeclContext to check whether a Decl is
inside the `std` namespace. Here, the first DeclContext of the `locale`
Decl is a LinkageSpecDecl so the method will return false.
We need to skip this LinkageSpecDecl to find the first DeclContext of
type Namespace and actually check whether we're in the `std` namespace.
More information about the All-commits
mailing list