Commit a533fc76 by Paolo Carlini Committed by Paolo Carlini

re PR c++/78344 (ICE on invalid c++ code on x86_64-linux-gnu (internal compiler…

re PR c++/78344 (ICE on invalid c++ code on x86_64-linux-gnu (internal compiler error: tree check: expected tree_list, have error_mark in cp_check_const_attributes, at cp/decl2.c:1347))

/cp
2018-01-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/78344
	* decl.c (grokdeclarator): Do not append the error_mark_node
	due to an erroneous optional attribute-specifier-seq.

/testsuite
2018-01-17  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/78344
	* g++.dg/cpp0x/alignas13.C: New.

From-SVN: r256821
parent 06b6c630
2018-01-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/78344
* decl.c (grokdeclarator): Do not append the error_mark_node
due to an erroneous optional attribute-specifier-seq.
2018-01-17 Jakub Jelinek <jakub@redhat.com> 2018-01-17 Jakub Jelinek <jakub@redhat.com>
PR c++/83897 PR c++/83897
......
...@@ -11491,9 +11491,15 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -11491,9 +11491,15 @@ grokdeclarator (const cp_declarator *declarator,
&& declarator->kind == cdk_id && declarator->kind == cdk_id
&& declarator->std_attributes && declarator->std_attributes
&& attrlist != NULL) && attrlist != NULL)
/* [dcl.meaning]/1: The optional attribute-specifier-seq following {
a declarator-id appertains to the entity that is declared. */ /* [dcl.meaning]/1: The optional attribute-specifier-seq following
*attrlist = chainon (*attrlist, declarator->std_attributes); a declarator-id appertains to the entity that is declared. */
if (declarator->std_attributes != error_mark_node)
*attrlist = chainon (*attrlist, declarator->std_attributes);
else
/* We should have already diagnosed the issue (c++/78344). */
gcc_assert (seen_error ());
}
/* Handle parameter packs. */ /* Handle parameter packs. */
if (parameter_pack_p) if (parameter_pack_p)
......
2018-01-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/78344
* g++.dg/cpp0x/alignas13.C: New.
2018-01-17 Jakub Jelinek <jakub@redhat.com> 2018-01-17 Jakub Jelinek <jakub@redhat.com>
PR c++/83897 PR c++/83897
......
// PR c++/78344
// { dg-do compile { target c++11 } }
alignas(double) int f alignas; // { dg-error "30:expected '\\('" }
alignas(double) int g alignas(double; // { dg-error "37:expected '\\)'" }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment