Commit 74537078 by Jason Merrill Committed by Jason Merrill

re PR c++/43076 (ICE: SIGSEGV with invalid C++ code after giving diagnostics)

	PR c++/43076
	* pt.c (push_template_decl_real): Deal better with running out of
	scopes before running out of template parms.

From-SVN: r157842
parent fb077955
2010-03-30 Jason Merrill <jason@redhat.com>
PR c++/43076
* pt.c (push_template_decl_real): Deal better with running out of
scopes before running out of template parms.
PR c++/41185
PR c++/41786
* parser.c (cp_parser_direct_declarator): Don't allow VLAs in
......
......@@ -4548,6 +4548,9 @@ push_template_decl_real (tree decl, bool is_friend)
if (current == decl)
current = ctx;
else if (current == NULL_TREE)
/* Can happen in erroneous input. */
break;
else
current = (TYPE_P (current)
? TYPE_CONTEXT (current)
......
2010-03-30 Jason Merrill <jason@redhat.com>
PR c++/43076
* g++.dg/template/error-recovery1.C: New.
PR c++/41786
* g++.dg/parse/ambig5.C: New.
......
// PR c++/43076
struct S;
template < typename > struct T
{
template < typename >
template < bool > struct T < S > // { dg-error "" }
{
void f () { // { 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