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

            Bug ID: 114315
           Summary: Attributes should be diagnosed when placed in the
                    middle of declaration specifiers
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: luigighiron at gmail dot com
  Target Milestone: ---

GCC will accept programs that use attribute specifiers in the middle of
declaration specifiers, for example:

int[[]]signed main(){}

Attribute specifiers are not allowed inside of the declaration specifiers. I
would expect a warning or an error here, at least when
-pedantic/-pedantic-errors. Here is a link to the grammar of declaration
specifiers: https://eel.is/c++draft/dcl.spec.general#nt:decl-specifier-seq. The
attribute specifier is required to be at the end of the declaration specifiers.

Reply via email to