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


Hi,

The C++ front-end currently fails on the following invalid testcase
with a tree check failure in
mangle_conv_op_name_for_type:

template<int> struct A {};
template<int N> struct B : A<N>
{
   using A<N>::operator typename A::X;
};

B<0> b;

This is because error_mark_node gets passed into
mangle_conv_op_name_for_type from tsubst_copy which can't handle it.
The proposed patch fixes this ICE by checking the return value from
tsubst in tsubst_copy before calling mangle_conv_op_name_for_type,
avoiding the ICE.

The second part of the patch addresses some follow up issues by making
push_class_level_binding and do_class_using_decl more robust in the
presence of error_mark_nodes.

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

Cheers,
Lee.

:ADDPATCH c++:

cp/

2006-06-18 Lee Millward <lee.millward@gmail.com>

	PR c++/28051
	* pt.c (tsubst_copy): Check for tsubst
	returning error_mark_node before calling
	mangle_conv_op_name_for_type.
	* name-lookup.c (push_class_level_binding): Robustify.
	(do_class_using_decl): Likewise.

testsuite/

2006-06-18 Lee Millward <lee.millward@gmail.com>

	PR c++/28051
	* g++.dg/template/using13.C: New test.

Attachment: pr28051.txt
Description: Text document


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