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

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

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

commit r10-6397-gb817be038d94c987e02c26ed2d81b6f2ebb5f97a
Author: Marek Polacek <pola...@redhat.com>
Date:   Fri Jan 31 19:28:10 2020 -0500

    c++: Fix ICE on invalid alignas in a template [PR93530]

    This fixes an ICE taking place in cp_default_conversion because we got
    a SCOPE_REF that doesn't have a type and so checking
    INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (exp)) will crash.
    This happens since the recent Joseph's change in decl_attributes whereby
    we don't skip C++11 attributes on types.

    [dcl.align] is clear that alignas applied to a function is ill-formed.
    That should be fixed, and we have PR90847 for that.  But I think a more
    appropriate fix at this stage would be the following: in a template we
    want to splice dependent attributes and save them for later, and by
    doing so avoid this crash.

        PR c++/93530 - ICE on invalid alignas in a template.
        * decl.c (grokdeclarator): Call cplus_decl_attributes instead of
        decl_attributes.

        * g++.dg/cpp0x/alignas18.C: New test.

Reply via email to