[clang] [clang][Itanium Mangle] Enable mangling of enclosing class for member… (PR #110503)
Haojian Wu via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 2 03:14:23 PDT 2024
================
@@ -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
More information about the cfe-commits
mailing list