* pt.c (tsubst_friend_class): Substitute into the context of the
friend before using it.
PR c++/6695
* g++.dg/template/friend7.C: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@55041
138bc75d-0d04-0410-961f-
82ee72b054a4
+2002-06-27 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/6695
+ * pt.c (tsubst_friend_class): Substitute into the context of the
+ friend before using it.
+
2002-06-26 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (xref_tag): Change prototype.
if (TREE_CODE (context) == NAMESPACE_DECL)
push_nested_namespace (context);
else
- push_nested_class (context, 2);
+ push_nested_class (tsubst (context, args, tf_none, NULL_TREE), 2);
}
/* First, we look for a class template. */
+2002-06-27 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/6695
+ * g++.dg/template/friend7.C: New file.
+
2002-06-27 Aldy Hernandez <aldyh@redhat.com>
* gcc.c-torture/execute/string-opt-8.c (strncmp): Fix typo in
--- /dev/null
+// { dg-do compile }
+
+template <typename V>
+struct b
+{
+ template <typename T>
+ class a
+ {
+ template <typename>
+ friend class a;
+
+ T t_;
+
+ public:
+ a() {}
+ a(a<T *> const &);
+ };
+};
+
+template <typename V>
+template <typename T>
+b<V>::a<T>::a(a<T *> const &rhs): t_(*rhs.t_)
+{}
+
+
+int
+f ()
+{
+ b<void *>::a<char *> q;
+ b<void *>::a<char> w(q);
+
+ return 0;
+}