Commit ad47b891 by Volker Reichelt Committed by Volker Reichelt

re PR c++/27315 (ICE with ill-placed expression)

	PR c++/27315
	* pt.c (do_decl_instantiation): Return early on invalid decl.

	* g++.dg/template/operator6.C: New test.
	* g++.dg/template/incomplete3.C: New test.

From-SVN: r113778
parent 7c60008e
2006-05-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-05-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27315
* pt.c (do_decl_instantiation): Return early on invalid decl.
PR c++/27559 PR c++/27559
* pt.c (push_template_decl_real): Return error_mark_node instead * pt.c (push_template_decl_real): Return error_mark_node instead
of broken decl. of broken decl.
......
...@@ -11215,7 +11215,7 @@ do_decl_instantiation (tree decl, tree storage) ...@@ -11215,7 +11215,7 @@ do_decl_instantiation (tree decl, tree storage)
tree result = NULL_TREE; tree result = NULL_TREE;
int extern_p = 0; int extern_p = 0;
if (!decl) if (!decl || decl == error_mark_node)
/* An error occurred, for which grokdeclarator has already issued /* An error occurred, for which grokdeclarator has already issued
an appropriate message. */ an appropriate message. */
return; return;
......
2006-05-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-05-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/27315
* g++.dg/template/operator6.C: New test.
* g++.dg/template/incomplete3.C: New test.
PR c++/27559 PR c++/27559
* g++.dg/template/new4.C: New test. * g++.dg/template/new4.C: New test.
// PR c++/27315
// { dg-do compile }
struct A; // { dg-error "forward declaration" }
template void A::foo<0>(); // { dg-error "before|incomplete" }
// PR c++/27315
// { dg-do compile }
template void operator+; // { dg-error "non-function" }
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