[clang] [clang][Itanium Mangle] Enable mangling of enclosing class for member… (PR #110503)

Viktoriia Bakalova via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 2 06:11:09 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())
----------------
VitaNuo wrote:

Yes sorry, I might have misinterpreted the comment above.

https://github.com/llvm/llvm-project/pull/110503


More information about the cfe-commits mailing list