public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/69585] [C++ 11] parser errors mixing alignas, C++ 11 and GNU attributes on class declaration
       [not found] <bug-69585-4@http.gcc.gnu.org/bugzilla/>
@ 2021-12-28  9:48 ` pinskia at gcc dot gnu.org
  2022-06-02 19:43 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-28  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dangelog at gmail dot com

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 102399 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/69585] [C++ 11] parser errors mixing alignas, C++ 11 and GNU attributes on class declaration
       [not found] <bug-69585-4@http.gcc.gnu.org/bugzilla/>
  2021-12-28  9:48 ` [Bug c++/69585] [C++ 11] parser errors mixing alignas, C++ 11 and GNU attributes on class declaration pinskia at gcc dot gnu.org
@ 2022-06-02 19:43 ` mpolacek at gcc dot gnu.org
  2022-06-04 13:59 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-06-02 19:43 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/69585] [C++ 11] parser errors mixing alignas, C++ 11 and GNU attributes on class declaration
       [not found] <bug-69585-4@http.gcc.gnu.org/bugzilla/>
  2021-12-28  9:48 ` [Bug c++/69585] [C++ 11] parser errors mixing alignas, C++ 11 and GNU attributes on class declaration pinskia at gcc dot gnu.org
  2022-06-02 19:43 ` mpolacek at gcc dot gnu.org
@ 2022-06-04 13:59 ` cvs-commit at gcc dot gnu.org
  2022-06-04 14:00 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-06-04 13:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:aec868578d8515763d75693c1fdfbc30ff0a1e68

commit r13-991-gaec868578d8515763d75693c1fdfbc30ff0a1e68
Author: Marek Polacek <polacek@redhat.com>
Date:   Thu Jun 2 15:44:20 2022 -0400

    c++: Allow mixing GNU/std-style attributes [PR69585]

    cp_parser_attributes_opt doesn't accept GNU attributes followed by
    [[]] attributes and vice versa; only a sequence of attributes of the
    same kind.  That causes grief for code like:

      struct __attribute__ ((may_alias)) alignas (2) struct S { };

    or

      #define EXPORT __attribute__((visibility("default")))
      struct [[nodiscard]] EXPORT F { };

    It doesn't seem to a documented restriction, so this patch fixes the
    problem.

    However, the patch does not touch the C FE.  The C FE doesn't have
    a counterpart to C++'s cp_parser_attributes_opt -- it only has
    c_parser_transaction_attributes (which parses both GNU and [[]]
    attributes), but that's TM-specific.  The C FE seems to use either
    c_parser_gnu_attributes or c_parser_std_attribute_specifier_sequence.
    As a consequence, this works:

      [[maybe_unused]] __attribute__((deprecated)) void f2 ();

    but this doesn't:

      __attribute__((deprecated)) [[maybe_unused]] void f1 ();

    I'm not sure what, if anything, should be done about this.

            PR c++/102399
            PR c++/69585

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_attributes_opt): Accept GNU attributes
            followed by [[]] attributes and vice versa.

    gcc/testsuite/ChangeLog:

            * g++.dg/ext/attrib65.C: New test.
            * g++.dg/ext/attrib66.C: New test.
            * g++.dg/ext/attrib67.C: New test.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/69585] [C++ 11] parser errors mixing alignas, C++ 11 and GNU attributes on class declaration
       [not found] <bug-69585-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2022-06-04 13:59 ` cvs-commit at gcc dot gnu.org
@ 2022-06-04 14:00 ` mpolacek at gcc dot gnu.org
  2023-02-15  3:53 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-06-04 14:00 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed in GCC 13.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/69585] [C++ 11] parser errors mixing alignas, C++ 11 and GNU attributes on class declaration
       [not found] <bug-69585-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2022-06-04 14:00 ` mpolacek at gcc dot gnu.org
@ 2023-02-15  3:53 ` pinskia at gcc dot gnu.org
  2023-06-23 20:32 ` pinskia at gcc dot gnu.org
  2023-06-23 20:33 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-02-15  3:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I see this only changed the C++ front-end. sudo just ran into a similar issue
for the C front-end, see PR 108796.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/69585] [C++ 11] parser errors mixing alignas, C++ 11 and GNU attributes on class declaration
       [not found] <bug-69585-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2023-02-15  3:53 ` pinskia at gcc dot gnu.org
@ 2023-06-23 20:32 ` pinskia at gcc dot gnu.org
  2023-06-23 20:33 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-23 20:32 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/69585] [C++ 11] parser errors mixing alignas, C++ 11 and GNU attributes on class declaration
       [not found] <bug-69585-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2023-06-23 20:32 ` pinskia at gcc dot gnu.org
@ 2023-06-23 20:33 ` pinskia at gcc dot gnu.org
  6 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-06-23 20:33 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |steveire at gmail dot com

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 96117 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-06-23 20:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-69585-4@http.gcc.gnu.org/bugzilla/>
2021-12-28  9:48 ` [Bug c++/69585] [C++ 11] parser errors mixing alignas, C++ 11 and GNU attributes on class declaration pinskia at gcc dot gnu.org
2022-06-02 19:43 ` mpolacek at gcc dot gnu.org
2022-06-04 13:59 ` cvs-commit at gcc dot gnu.org
2022-06-04 14:00 ` mpolacek at gcc dot gnu.org
2023-02-15  3:53 ` pinskia at gcc dot gnu.org
2023-06-23 20:32 ` pinskia at gcc dot gnu.org
2023-06-23 20:33 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).