@@ -3227,6 +3227,9 @@ make_unbound_class_template (tree context, tree name, tree parm_list,
if (MAYBE_CLASS_TYPE_P (context))
tmpl = lookup_field (context, name, 0, false);
+ if (tmpl && TREE_CODE (tmpl) == TYPE_DECL)
+ tmpl = maybe_get_template_decl_from_type_decl (tmpl);
+
if (!tmpl || !DECL_CLASS_TEMPLATE_P (tmpl))
{
if (complain & tf_error)
new file mode 100644
@@ -0,0 +1,9 @@
+// DR 1004
+
+template <class T, template<class>class U = T::template B> struct A { };
+
+template <class T> struct B {
+ template <class U> friend struct B;
+};
+
+A<B<int> > a;