Commit 7e1e0765 by Volker Reichelt Committed by Volker Reichelt

re PR c++/26070 (ICE declaring data member virtual and static)

	PR c++/26070
	* decl.c (grokdeclarator): Clear storage_class together with staticp.

	* g++.dg/other/virtual1.C: New test.

From-SVN: r110747
parent 053007ce
2006-02-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/26070
* decl.c (grokdeclarator): Clear storage_class together with staticp.
2006-02-07 Gabriel Dos Reis <gdr@integrable-solutions.net> 2006-02-07 Gabriel Dos Reis <gdr@integrable-solutions.net>
* cp-tree.h (tf_warning_or_error): Renamed from tf_warn_or_error. * cp-tree.h (tf_warning_or_error): Renamed from tf_warn_or_error.
......
...@@ -7128,6 +7128,7 @@ grokdeclarator (const cp_declarator *declarator, ...@@ -7128,6 +7128,7 @@ grokdeclarator (const cp_declarator *declarator,
if (virtualp && staticp == 2) if (virtualp && staticp == 2)
{ {
error ("member %qD cannot be declared both virtual and static", dname); error ("member %qD cannot be declared both virtual and static", dname);
storage_class = sc_none;
staticp = 0; staticp = 0;
} }
friendp = !! declspecs->specs[(int)ds_friend]; friendp = !! declspecs->specs[(int)ds_friend];
......
2006-02-08 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/26070
* g++.dg/other/virtual1.C: New test.
2006-02-08 Paolo Bonzini <bonzini@gnu.org> 2006-02-08 Paolo Bonzini <bonzini@gnu.org>
* lib/gcc-dg.exp (cleanup-rtl-dump, cleanup-tree-dump, * lib/gcc-dg.exp (cleanup-rtl-dump, cleanup-tree-dump,
// PR c++/26070
// { dg-do compile }
struct A
{
virtual static int i; // { dg-error "virtual" }
};
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