re PR c++/20646 (ICE on illegal code: "extern static" struct member)

PR c++/20646
	* decl.c (grokdeclarator): Reset storage_class after error.

	* g++.dg/other/mult-stor1.C: New test.

From-SVN: r102935
This commit is contained in:
Volker Reichelt 2005-08-10 00:20:32 +00:00 committed by Volker Reichelt
parent e04f4a0c4d
commit a23e08d92d
4 changed files with 22 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-08-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/20646
* decl.c (grokdeclarator): Reset storage_class after error.
2005-08-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/22508

View File

@ -7064,7 +7064,10 @@ grokdeclarator (const cp_declarator *declarator,
/* Warn about storage classes that are invalid for certain
kinds of declarations (parameters, typenames, etc.). */
if (declspecs->multiple_storage_classes_p)
error ("multiple storage classes in declaration of %qs", name);
{
error ("multiple storage classes in declaration of %qs", name);
storage_class = sc_none;
}
else if (thread_p
&& ((storage_class
&& storage_class != sc_extern

View File

@ -1,3 +1,8 @@
2005-08-10 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/20646
* g++.dg/other/mult-stor1.C: New test.
2005-08-09 Andrew Pinski <pinskia@physics.uc.edu>
* gcc.c-torture/pr18299-1.c: Move to ...

View File

@ -0,0 +1,8 @@
// PR c++/20646
// Origin: Dan Rosen <dan.rosen@gmail.com>
// { dg-do compile }
struct A
{
extern static int i; // { dg-error "multiple storage classes" }
};