re PR c++/18586 (ICE on invalid template member declaration)

PR c++/18586
	* parser.c (cp_parser_init_declarator): Do not pop scope twice.

	PR c++/18586
	* g++.dg/template/crash27.C: New test.

From-SVN: r91182
This commit is contained in:
Mark Mitchell 2004-11-24 18:10:26 +00:00 committed by Mark Mitchell
parent fc57e2c7ef
commit 62a4d9428b
4 changed files with 19 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2004-11-24 Mark Mitchell <mark@codesourcery.com>
PR c++/18586
* parser.c (cp_parser_init_declarator): Do not pop scope twice.
PR c++/18530
* cp-tree.h (CTOR_NAME): Remove.
(DTOR_NAME): Remove.

View File

@ -10590,7 +10590,10 @@ cp_parser_init_declarator (cp_parser* parser,
if (member_p)
{
if (pop_p)
pop_scope (scope);
{
pop_scope (scope);
pop_p = false;
}
decl = grokfield (declarator, decl_specifiers,
initializer, /*asmspec=*/NULL_TREE,
/*attributes=*/NULL_TREE);

View File

@ -1,5 +1,8 @@
2004-11-24 Mark Mitchell <mark@codesourcery.com>
PR c++/18586
* g++.dg/template/crash27.C: New test.
PR c++/18530
* g++.dg/warn/Wshadow-3.C: New test.

View File

@ -0,0 +1,9 @@
template <typename T>
void f(int, T (*)() = 0);
void g() {
typedef int A[2];
f<A>(0); // { dg-error "" }
typedef void F();
f<F>(0); // { dg-error "" }
}