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

Utkarsh Saxena via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 30 07:38:11 PDT 2024


================
@@ -704,6 +704,15 @@ ItaniumMangleContextImpl::getEffectiveDeclContext(const Decl *D) {
       return D->getLexicalDeclContext()->getRedeclContext();
   }
 
+  if (const auto *FTD = dyn_cast<FunctionTemplateDecl>(D)) {
+    // Member-like constrained friends are mangled as if they were members of
+    // the enclosing class.
+    if (FTD->getTemplatedDecl()->isMemberLikeConstrainedFriend() &&
+        getASTContext().getLangOpts().getClangABICompat() >
+            LangOptions::ClangABI::Ver19)
+      return D->getLexicalDeclContext()->getRedeclContext();
----------------
usx95 wrote:

This looks quite a tech debt. I am not aware of our policy regarding the past ABIs we should be supporting, but there definitely should be a time limit.
We should add a fixme to remove ABI checks after supported time
```
FIXME: Remove check for Ver17 and use D->getAsFunction() after clang-X
FIXME: Remove check for Ver19 after clang-Y
``` 
@zygoloid Are you aware of a reasonable clang version (X and Y here) after which we should stop supporting Ver17 ? I can guess maybe 1-3 years ?

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


More information about the cfe-commits mailing list