[PATCH] D126061: [clang] Reject non-declaration C++11 attributes on declarations
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 23 08:18:23 PDT 2022
aaron.ballman added a comment.
In D126061#3605276 <https://reviews.llvm.org/D126061#3605276>, @miyuki wrote:
> Hi Martin,
>
> I think this patch caused a regression in diagnostics. Clang used to warn about the following code:
>
> struct X {
> [[deprecated]] struct Y {};
> };
>
>
>
> $ clang -std=c++17 -Wall test.cpp
> <source>:2:7: warning: attribute 'deprecated' is ignored, place it after "struct" to apply attribute to type declaration [-Wignored-attributes]
> [[deprecated]] struct Y {};
> ^
>
> And now it doesn't. Could you please have a look into it?
Good catch, that does appear to be a regression:
http://eel.is/c++draft/class#nt:member-declaration
http://eel.is/c++draft/class#mem.general-14
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126061/new/
https://reviews.llvm.org/D126061
More information about the cfe-commits
mailing list