[clang] [clang] Use the union of abi_tags from all declarations of an inline namespace (PR #224826)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 21 06:55:29 PDT 2026
AaronBallman wrote:
> Propagating the abi tag from the first namespace declaration to later declarations is fine; the problem is propagating tags backwards.
+1, it's pretty normal behavior for attributes to be (inherited and) additive on redeclarations. But propagating attribute information backwards is generally not something we do. In those cases, we usually require the first declaration to carry all the information instead.
> In terms of the implementation, the way this patch is written, it has the side-effect that the mangling of a symbol depends on when we decide to mangle it. We typically don't wait for the end of the translation unit before we start mangling values.
Yeah, that seems be problematic. For example, we sometimes need to get the mangled name for things as part of diagnostic checking: https://github.com/llvm/llvm-project/blob/ddc7d4b3b43be5ef26671c19035761fb84a40388/clang/lib/Sema/SemaDeclAttr.cpp#L1761
https://github.com/llvm/llvm-project/pull/224826
More information about the cfe-commits
mailing list