commit affd3dcbcfeeda70db2413f19948dfd039ce0a0a
Author: Jason Merrill <jason@redhat.com>
Date: Fri May 24 13:52:31 2013 -0400
PR c++/56971
* pt.c (any_template_arguments_need_structural_equality_p): A
TEMPLATE_TEMPLATE_PARM can require structural type comparison.
@@ -20397,8 +20397,7 @@ any_template_arguments_need_structural_equality_p (tree args)
if (error_operand_p (arg))
return true;
- else if (TREE_CODE (arg) == TEMPLATE_DECL
- || TREE_CODE (arg) == TEMPLATE_TEMPLATE_PARM)
+ else if (TREE_CODE (arg) == TEMPLATE_DECL)
continue;
else if (TYPE_P (arg) && TYPE_STRUCTURAL_EQUALITY_P (arg))
return true;
new file mode 100644
@@ -0,0 +1,21 @@
+// PR c++/56971
+
+template <typename T>
+class rp {
+};
+
+template <template <typename> class P>
+struct b {
+ template <class, template <typename> class FriendP>
+ friend void f(b<FriendP> from);
+};
+
+template <class, template <typename> class P>
+void f(b<P> from) {
+}
+
+int main() {
+ b<rp> v;
+ f<int>(v);
+ return 0;
+}