re PR c++/31747 (ICE combining static and extern)

cp/
2007-10-26  Paolo Carlini  <pcarlini@suse.de>

	PR c++/31747
	* decl.c (grokdeclarator): In case of conflicting specifiers
	just return error_mark_node.

testsuite/
2007-10-26  Paolo Carlini  <pcarlini@suse.de>

	PR c++/31747
	* g++.dg/parse/crash39.C: New.

From-SVN: r129647
This commit is contained in:
Paolo Carlini 2007-10-26 09:57:12 +00:00 committed by Paolo Carlini
parent 0f095169ae
commit 9b70c6b078
4 changed files with 24 additions and 9 deletions

View File

@ -1,3 +1,9 @@
2007-10-26 Paolo Carlini <pcarlini@suse.de>
PR c++/31747
* decl.c (grokdeclarator): In case of conflicting specifiers
just return error_mark_node.
2007-10-26 Ollie Wild <aaw@google.com>
* expr.c (cxx_expand_expr): Removed.

View File

@ -7552,6 +7552,12 @@ grokdeclarator (const cp_declarator *declarator,
return error_mark_node;
}
if (declspecs->conflicting_specifiers_p)
{
error ("conflicting specifiers in declaration of %qs", name);
return error_mark_node;
}
/* Extract the basic type from the decl-specifier-seq. */
type = declspecs->type;
if (type == error_mark_node)
@ -7846,15 +7852,10 @@ grokdeclarator (const cp_declarator *declarator,
error ("multiple storage classes in declaration of %qs", name);
thread_p = false;
}
if (declspecs->conflicting_specifiers_p)
{
error ("conflicting specifiers in declaration of %qs", name);
storage_class = sc_none;
}
else if (decl_context != NORMAL
&& ((storage_class != sc_none
&& storage_class != sc_mutable)
|| thread_p))
if (decl_context != NORMAL
&& ((storage_class != sc_none
&& storage_class != sc_mutable)
|| thread_p))
{
if ((decl_context == PARM || decl_context == CATCHPARM)
&& (storage_class == sc_register

View File

@ -1,3 +1,8 @@
2007-10-26 Paolo Carlini <pcarlini@suse.de>
PR c++/31747
* g++.dg/parse/crash39.C: New.
2007-10-26 Uros Bizjak <ubizjak@gmail.com>
* g++.dg/tree-ssa/ivopts-1.C: Remove xfail on the search for

View File

@ -0,0 +1,3 @@
// PR c++/31747
static extern int i; // { dg-error "conflicting specifiers" }