]> git.ipfire.org Git - thirdparty/gcc.git/commit
backport: re PR c++/83824 (ICE on invalid C++ code with alignas: in chainon, at tree...
authorJakub Jelinek <jakub@redhat.com>
Mon, 25 Jun 2018 17:12:28 +0000 (19:12 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 25 Jun 2018 17:12:28 +0000 (19:12 +0200)
commit4f5e1f100a125886ddea40e7bc6ca10d18b04e99
tree2411735d2c0d18ea6a304a25378db3128c6f132a
parent74c51b2a0cc25060fd941ce15fb3bf3a85facbbe
backport: re PR c++/83824 (ICE on invalid C++ code with alignas: in chainon, at tree.c:3037)

Backported from mainline
2018-01-18  Jakub Jelinek  <jakub@redhat.com>

PR c++/83824
* parser.c (attr_chainon): New function.
(cp_parser_label_for_labeled_statement, cp_parser_decl_specifier_seq,
cp_parser_namespace_definition, cp_parser_init_declarator,
cp_parser_type_specifier_seq, cp_parser_parameter_declaration,
cp_parser_gnu_attributes_opt): Use it.
(cp_parser_member_declaration, cp_parser_objc_class_ivars,
cp_parser_objc_struct_declaration): Likewise.  Don't reset
prefix_attributes if attributes is error_mark_node.

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

From-SVN: r262054
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr83824.C [new file with mode: 0644]