-Wmissing-prototypes: Don't warn in named namespaces nested in anonymous namespaces

This commit is contained in:
David Blaikie 2022-01-04 10:07:50 -08:00
parent 2edc21e856
commit e1e74f6cd6
2 changed files with 4 additions and 1 deletions

View File

@ -3251,7 +3251,6 @@ bool FunctionDecl::isGlobal() const {
if (const auto *Namespace = cast<NamespaceDecl>(DC)) {
if (!Namespace->getDeclName())
return false;
break;
}
}

View File

@ -13,6 +13,10 @@ namespace NS {
namespace {
// Don't warn about functions in anonymous namespaces.
void f() { }
// Even if they're in nested namespaces within an anonymous namespace.
namespace NS {
void f() { }
}
}
struct A {