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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 13 07:56:43 PDT 2026


erichkeane wrote:

> > But defining that namespace inside of user-code is UB?
> 
> Yes, but it happens and the warning is about such cases. ABI tags beyond system headers and system'ish projects are almost not used.

Hmm... I'd like to hear from Aaron.  I would still think that warning on the 2nd declaration is the 'right' decision, and I can see the justification for marking it warn-in-headers as a result (with a note on the 'previous' declaration).

Because The INVERSE can happen too of course, imagine: 
```
#include <whatever> #1
<user code>#2
#include <whatever 2> #3?
```

Which one should get the diagnostic?  It seems to me that having the declaration in 2 cause the diagnostic to happen in 1 would be wrong as well.

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


More information about the cfe-commits mailing list