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++/27668


Hi,

The C++ front end currently chokes on the following invalid testcase:

template<typename class T, T = T()> struct A {};
template<int> void foo(A<int>);

The attached patch fixes the ICE by returning error_mark_node from
coerce_template_parms if convert_template_argument failed. The comment
at the top of coerce_template_parms says that error_mark_node is
returned if any error occurred, but that wasn't the case with the
above testcase.

Bootstrapped and regression tested with no new failures on
i686-pc-linux-gnu. Ok for mainline and 4.1/4.0 branches?

Cheers,
Lee.

:ADDPATCH c++:

cp/

2006-07-20 Lee Millward <lee.millward@gmail.com>

       PR c++/27668
       * pt.c (coerce_template_parms): If convert_template_argument
       failed, return error_mark_node.

testsuite/

2006-07-20 Lee Millward <lee.millward@gmail.com>

       PR c++/27668
       * g++.dg/template/crash55.C: New test.

Attachment: pr27668.txt
Description: Text document


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