dmpolukhin wrote:
Which declaration is wrong depends on where the two declarations live. If both
are in user code, I agree: the reopening is the one trying to add tags, so it
should get the warning, with "previous declaration is here". But in the case
that motivated this, the tag-adding declaration is libstdc++'s `inline
namespace __cxx11 __attribute__((__abi_tag__("cxx11")))`, and that one is
correct. The wrong one is the user's untagged forward declaration that came
first, and a warning on libstdc++'s declaration would be suppressed anyway
because it's in a system header.
So I'd suggest warning at whichever declaration is not in a system header: the
reopening by default, with your wording and "previous declaration is here", and
the first declaration only when the reopening is in a system header, with
"later declaration is here".
https://github.com/llvm/llvm-project/pull/221039
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits