https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127044

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
In the grammar, it is a declaration.
Not just in this form, but also in [[gnu::assume (expr)]]; case (for C89
pedantic
one needs to use [[__extension__ gnu::assume (expr)]];.
For [[]] attributes, C23 is clear on that, see C23 6.7:
declaration:
  declaration-specifiers init-declarator-list[opt] ;
  attribute-specifier-sequence declaration-specifiers init-declarator-list ;
  static_assert-declaration
  attribute-declaration
...
attribute-declaration:
  attribute-specifier-sequence ;

__attribute__ form is a GNU extension, whether clang implemented it incorrectly
or not doesn't imply anything on GCC correctness in this regard.

Reply via email to