================
@@ -45,18 +46,21 @@ void CalleeNamespaceCheck::check(const
MatchFinder::MatchResult &Result) {
if (FuncDecl->getBuiltinID() != 0)
return;
- // If the outermost namespace of the function is __llvm_libc, we're good.
+ // If the outermost namespace of the function is a macro that starts with
+ // __llvm_libc, we're good.
const auto *NS = dyn_cast<NamespaceDecl>(getOutermostNamespace(FuncDecl));
- if (NS && NS->getName() == "__llvm_libc")
+ if (NS && Result.SourceManager->isMacroBodyExpansion(NS->getLocation()) &&
+ NS->getName().starts_with(RequiredNamespaceStart))
----------------
PiotrZSL wrote:
Thing that I was concern here, were mainly why starts_with instead of just
operator=, are there some other namespaces like __llvm_libc_xyz ? If yes then
this is fine, if not then maybe we do not need to change this.
https://github.com/llvm/llvm-project/pull/68134
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits