This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch] Fix PR c++/29363
- From: "Lee Millward" <lee dot millward at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 18 Oct 2006 15:56:14 +0100
- Subject: [patch] Fix PR c++/29363
Hi,
The following testcase triggers a seg fault in instantiate_class_template:
template<int> void foo()
{
throw A();
struct A {} a;
}
template void foo<0>();
An appropiate error is issued for the "throw A();" line in
unqualified_fn_lookup_error but the broken identifier for "A" is still
returned back to the caller. Simply changing this to return
error_mark_node to indicate the identifier is invalid instead fixes
the problem which is what the attached patch does.
Bootstrapped and regression tested on i686-pc-linux-gnu, ok for mainline?
Cheers,
Lee.
:ADDPATCH c++:
cp/
2006-10-18 Lee Millward <lee.millward@codesourcery.com>
PR c++/29363
* lex.c (unqualified_fn_lookup_error): Return error_mark_node
rather than the broken identifier if no declaration for it is available.
testsuite/
2006-10-18 Lee Millward <lee.millward@codesourcery.com>
PR c++/29363
* g++.dg/template/crash61.C: New test.