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

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:801fb71f83624f0bf6d6bd27121d4a332103f7be

commit r15-7414-g801fb71f83624f0bf6d6bd27121d4a332103f7be
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Fri Feb 7 14:28:57 2025 +0100

    c++: Use cplus_decl_attributes rather than decl_attributes in grokdecl
[PR118773]

    My r15-3046 change regressed the first half of the following testcase.
    When it calls decl_attributes, it doesn't handle attributes with
    dependent arguments correctly and so is now rejected that N is not
    a constant integer during template parsing.

    I've actually followed the pointer/reference case which did that
    too and that one has been failing for a couple of years on the
    second part of the testcase.

    Note, there is also
              if (decl_context != PARM && decl_context != TYPENAME)
                /* Assume that any attributes that get applied late to
                   templates will DTRT when applied to the declaration
                   as a whole.  */
                late_attrs = splice_template_attributes (&attrs, type);
              returned_attrs = decl_attributes (&type,
                                                attr_chainon (returned_attrs,
                                                              attrs),
                                                attr_flags);
              returned_attrs = attr_chainon (late_attrs, returned_attrs);
    call directly to decl_attributes in grokdeclarator, but this one handles
    the splicing manually, so maybe it is ok as is (and I don't have a testcase
    of anything misbehaving for that).

    2025-02-07  Jakub Jelinek  <ja...@redhat.com>

            PR c++/118773
            * decl.cc (grokdeclarator): Use cplus_decl_attributes rather than
            decl_attributes for std_attributes on pointer and array types.

            * g++.dg/cpp0x/gen-attrs-87.C: New test.
            * g++.dg/gomp/attrs-3.C: Adjust expected diagnostics.

Reply via email to