Index: clang/lib/AST/Decl.cpp =================================================================== --- clang/lib/AST/Decl.cpp +++ clang/lib/AST/Decl.cpp @@ -1557,16 +1557,16 @@ // for linkage purposes. But internal linkage declarations in the global // module fragment of a particular module are owned by that module for // linkage purposes. + // FIXME: p1815 removes the need for this distinction -- there are no + // internal linkage declarations that need to be referred to from outside + // this TU. if (IgnoreLinkage) return nullptr; bool InternalLinkage; if (auto *ND = dyn_cast(this)) InternalLinkage = !ND->hasExternalFormalLinkage(); - else { - auto *NSD = dyn_cast(this); - InternalLinkage = (NSD && NSD->isAnonymousNamespace()) || - isInAnonymousNamespace(); - } + else + InternalLinkage = isInAnonymousNamespace(); return InternalLinkage ? M->Parent : nullptr; }