[clang] [clang] Diagnose when spelled 'abi_tag' on namespace doesn't match applied one. (PR #221039)

Volodymyr Sapsai via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 25 12:49:09 PDT 2026


vsapsai wrote:

Ok, I'll update AttrDocs.td pointing out that Clang cares about the first namespace declaration (not exact wording). I won't describe the specifics of divergences with GCC as we don't control that.

Comment in https://github.com/llvm/llvm-project/pull/224826#issuecomment-5828586359 makes sense, I'll change the patch to be less aggressive when a "redeclaration" has fewer tags.

I'm not sure about
> report the warning at the first declaration [...]

My view is that the first namespace is correct (most likely system-provided) but additional namespaces are wrong (most likely user-provided). @dmpolukhin is your view the opposite? I have slight preference to my interpretation but don't have any actual evidence that's the common scenario.

And the question to everyone – should I make it just a warning, not a warning-as-error-by-default? Personally, I don't have a strong opinion but got an impression that an error-by-default might be too harsh.

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


More information about the cfe-commits mailing list