* pt.c (tsubst_friend_class): Return early on invalid friend
declarations.
* g++.dg/template/void2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113776
138bc75d-0d04-0410-961f-
82ee72b054a4
+2006-05-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27496
+ * pt.c (tsubst_friend_class): Return early on invalid friend
+ declarations.
+
2006-05-14 H.J. Lu <hongjiu.lu@intel.com>
* Make-lang.in (cp/decl.o): Add dependency on $(TARGET_H).
case, the instantiation of the template class will cause the
injection of this template into the global scope. */
tmpl = tsubst (friend_tmpl, args, tf_warning_or_error, NULL_TREE);
+ if (tmpl == error_mark_node)
+ return error_mark_node;
/* The new TMPL is not an instantiation of anything, so we
forget its origins. We don't reset CLASSTYPE_TI_TEMPLATE for
+2006-05-15 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/27496
+ * g++.dg/template/void2.C: New test.
+
2006-05-14 Alexandre Oliva <aoliva@redhat.com>
* g++.dg/template/dependent-expr5.C: New test.
--- /dev/null
+// PR c++/27496
+// { dg-do compile }
+
+template<int> struct A
+{
+ template<void> friend class X; // { dg-error "void" }
+};
+
+A<0> a; // { dg-error "instantiated" }