Commit ae9b2a48 by H.J. Lu Committed by H.J. Lu

re PR c++/39060 (ICE with lots of invalid member functions)

gcc/cp/

2009-03-08  H.J. Lu  <hongjiu.lu@intel.com>

	PR c++/39060
	* parser.c (cp_parser_late_parsing_default_args): Continue
	the loop when cp_parser_assignment_expression returns
	error_mark_node.

gcc/testsuite/

2009-03-08  H.J. Lu  <hongjiu.lu@intel.com>

	PR c++/39060
	* g++.dg/other/new1.C: Adjusted.
	* g++.dg/parse/crash40.C: Likewise.
	* g++.dg/parse/defarg12.C: Likewise.
	* g++.dg/template/error15.C: Likewise.

	* g++.dg/other/pr39060.C: New.

From-SVN: r144710
parent 975a4fd6
2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
PR c++/39060
* parser.c (cp_parser_late_parsing_default_args): Continue
the loop when cp_parser_assignment_expression returns
error_mark_node.
2009-03-07 Jason Merrill <jason@redhat.com>
PR c++/39367
......
......@@ -18291,6 +18291,11 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
/* Parse the assignment-expression. */
parsed_arg = cp_parser_assignment_expression (parser, /*cast_p=*/false, NULL);
if (parsed_arg == error_mark_node)
{
cp_parser_pop_lexer (parser);
continue;
}
if (!processing_template_decl)
parsed_arg = check_default_argument (TREE_VALUE (parm), parsed_arg);
......
2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
PR c++/39060
* g++.dg/other/new1.C: Adjusted.
* g++.dg/parse/crash40.C: Likewise.
* g++.dg/parse/defarg12.C: Likewise.
* g++.dg/template/error15.C: Likewise.
* g++.dg/other/pr39060.C: New.
2009-03-07 Jason Merrill <jason@redhat.com>
PR c++/39367
......
......@@ -10,5 +10,5 @@ struct A
void foo()
{
new A;
new A; // { dg-error "default argument" }
}
// PR c++/39060
// { dg-do compile }
struct A
{
A(void* i=); // { dg-error "with|specification" }
A(void* i=); // { dg-error "overloaded" }
A(void* i=); // { dg-error "overloaded" }
void operator+ (void* i=); // { dg-error "arguments" }
virtual void foo1(=); // { dg-error "identifier" }
void foo2(=); // { dg-error "identifier" }
void foo3(=); // { dg-error "identifier" }
void foo4(=); // { dg-error "identifier" }
void foo5(=); // { dg-error "identifier" }
}; // { dg-error "primary-expression" }
A::A (void* i=) {} // { dg-error "primary-expression|argument" }
......@@ -37,6 +37,6 @@ void bar()
int i;
i.C::foo<0>(); /* { dg-error "which is of non-class type" } */
S<false> s;
S<false> s; /* { dg-error "default argument" } */
SS<false> ss; /* { dg-error "within this context" } */
}
......@@ -9,5 +9,5 @@ struct A
void foo()
{
A().i;
A().i; /* { dg-error "default argument" } */
}
......@@ -18,7 +18,7 @@ protected:
template <class T>
void B<T>::g(void) {
f();
f(); // { dg-error "default argument" }
}
template class B<long>;
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