Commit 62a4d942 by Mark Mitchell Committed by Mark Mitchell

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
parent fc57e2c7
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.
......
......@@ -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);
......
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.
......
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 "" }
}
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