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

            Bug ID: 118773
           Summary: [15 Regression] Invalid rejection of attribute with
                    dependent argument since r15-3046
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

My r15-3046-gd05949558ef1c8eeeb07399174a64f968f70e3ee fix regressed
template <unsigned N>
using T = char[4] [[gnu::aligned (N)]];
T<2> t;
testcase:
~/src/gcc/obj84/gcc/cc1plus -quiet rh2344173.C
rh2344173.C:2:38: error: requested alignment is not an integer constant
    2 | using T = char[4] [[gnu::aligned (N)]];
      |                                      ^
The bug is in using decl_attribute rather than cplus_decl_attribute.

Note, I've just followed what we were doing before with pointers, and
template <unsigned N>
using U = char *[[gnu::aligned (N)]]*;
U<__alignof (char *)> u;
is rejected since r10-4969-g1723e1bedb9545c45619c4023729755243524584
(before the attribute has been (incorrectly) ignored with a warning about
that).

There is a third decl_attribute call on returned_attrs, but am not sure when
that is actually used...

Reply via email to