PR c++/11030
* pt.c (instantiate_class_template): Don't call xref_tag to
inject name when the friend class is a specialization.
* g++.dg/template/friend19.C: New test.
From-SVN: r69088
+2003-07-08 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/11030
+ * pt.c (instantiate_class_template): Don't call xref_tag to
+ inject name when the friend class is a specialization.
+
2003-07-07 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (build_scoped_method_call): Remove.
else if (uses_template_parms (friend_type))
new_friend_type = tsubst (friend_type, args,
tf_error | tf_warning, NULL_TREE);
+ else if (CLASSTYPE_USE_TEMPLATE (friend_type))
+ new_friend_type = friend_type;
else
{
tree ns = decl_namespace_context (TYPE_MAIN_DECL (friend_type));
+2003-07-08 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/11030
+ * g++.dg/template/friend19.C: New test.
+
2003-07-08 Jakub Jelinek <jakub@redhat.com>
* g++.dg/opt/strength-reduce.C: New test.
--- /dev/null
+// { dg-do compile }
+
+// Origin: Benjamin Li <benxbli@yahoo.com>
+
+// PR c++/11030: Template substition of friend class that is
+// a specialization.
+
+template <int S>
+struct A
+{
+ void func(void);
+};
+
+template <class T>
+class C
+{
+ static void private_func(void) {}
+public:
+ friend class A<512>;
+};
+
+template <int S>
+void A<S>::func(void)
+{
+ C<void>::private_func();
+}
+
+template class A<512>;