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


Hi,

Given the following invalid testcase the C++ front-end ICE's with a
tree check failure in cp_parser_elaborated_type_specifier:

template<int> struct A;
struct __attribute__((unused)) A<0<;

This is caused by the variable type being set to error_mark_node,
which when passed to CLASSTYPE_TEMPLATE_INSTANTIATION triggers the
ICE. The proposed patch below fixes this by checking for type being
equal to error_mark_node before processing the attributes.

Bootstrapped ans regresstion tested with no new failures on
i686-pc-linux-gnu, ok for mainline?

:ADDPATCH C++:

cp/

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

	PR c++/28269
	* parser.c(cp_parser_elaborated_type_specifier): Return
       early if an invalid type was detected.

testsuite/

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

	PR c++/28269
	* g++.dg/template/crash54.C: New test.

Attachment: pr28269.txt
Description: Text document


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