re PR c++/58649 (ICE with use of enum before declaration)

/cp
2014-01-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58649
	* pt.c (lookup_template_class_1): Check start_enum return value
	for error_mark_node.

/testsuite
2014-01-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58649
	* g++.dg/template/crash117.C: New.

From-SVN: r207304
This commit is contained in:
Paolo Carlini 2014-01-30 14:28:55 +00:00 committed by Paolo Carlini
parent cc27b5cd86
commit e1b317aecf
4 changed files with 23 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58649
* pt.c (lookup_template_class_1): Check start_enum return value
for error_mark_node.
2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (duplicate_decls, typename_hash, typename_compare):

View File

@ -7521,6 +7521,9 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
tsubst (ENUM_UNDERLYING_TYPE (template_type),
arglist, complain, in_decl),
SCOPED_ENUM_P (template_type), NULL);
if (t == error_mark_node)
return t;
}
else
{

View File

@ -1,3 +1,8 @@
2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58649
* g++.dg/template/crash117.C: New.
2014-01-30 Richard Biener <rguenther@suse.de>
PR c/59905

View File

@ -0,0 +1,9 @@
// PR c++/58649
template<typename> void foo()
{
E(); // { dg-error "declaration|declared" }
enum E {};
}
template void foo<int>();