* pt.c (do_decl_instantiation): Return early on invalid decl.
* g++.dg/template/operator6.C: New test.
* g++.dg/template/incomplete3.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113778
138bc75d-0d04-0410-961f-
82ee72b054a4
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
* pt.c (push_template_decl_real): Return error_mark_node instead
of broken decl.
tree result = NULL_TREE;
int extern_p = 0;
- if (!decl)
+ if (!decl || decl == error_mark_node)
/* An error occurred, for which grokdeclarator has already issued
an appropriate message. */
return;
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
* g++.dg/template/new4.C: New test.
--- /dev/null
+// PR c++/27315
+// { dg-do compile }
+
+struct A; // { dg-error "forward declaration" }
+template void A::foo<0>(); // { dg-error "before|incomplete" }
--- /dev/null
+// PR c++/27315
+// { dg-do compile }
+
+template void operator+; // { dg-error "non-function" }