================ @@ -693,14 +693,13 @@ ItaniumMangleContextImpl::getEffectiveDeclContext(const Decl *D) { if (VD->isExternC()) return getASTContext().getTranslationUnitDecl(); - if (const auto *FD = D->getAsFunction()) { - if (FD->isExternC()) - return getASTContext().getTranslationUnitDecl(); + if (const auto *FD = getASTContext().getLangOpts().getClangABICompat() > + LangOptions::ClangABI::Ver19 + ? D->getAsFunction() + : dyn_cast<FunctionDecl>(D)) { // Member-like constrained friends are mangled as if they were members of // the enclosing class. - if (FD->isMemberLikeConstrainedFriend() && - getASTContext().getLangOpts().getClangABICompat() > - LangOptions::ClangABI::Ver17) + if (FD->isMemberLikeConstrainedFriend()) ---------------- hokein wrote:
this looks like a behavior change, we should keep the `getClangABICompat() > LangOptions::ClangABI::Ver17` check. https://github.com/llvm/llvm-project/pull/110503 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits