Commit e1b317ae by Paolo Carlini Committed by Paolo Carlini

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
parent cc27b5cd
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):
Use TYPE_IDENTIFIER.
* error.c (dump_type): Likewise.
......
......@@ -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
{
......
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
......
// PR c++/58649
template<typename> void foo()
{
E(); // { dg-error "declaration|declared" }
enum E {};
}
template void foo<int>();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment