This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]