re PR c++/56971 (GCC claims a friend function to be overloaded, but it isn't)
authorJason Merrill <jason@redhat.com>
Fri, 24 May 2013 20:02:07 +0000 (16:02 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 24 May 2013 20:02:07 +0000 (16:02 -0400)
PR c++/56971
* pt.c (any_template_arguments_need_structural_equality_p): A
TEMPLATE_TEMPLATE_PARM can require structural type comparison.

From-SVN: r199315

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.dg/template/ttp28.C [new file with mode: 0644]

index 7b02b8b3b5b84f3bf83b08db702f59fc4980c891..4d139557523be69619f5d46fa3931f1f40c379fe 100644 (file)
@@ -1,3 +1,9 @@
+2013-05-24  Jason Merrill  <jason@redhat.com>
+
+       PR c++/56971
+       * pt.c (any_template_arguments_need_structural_equality_p): A
+       TEMPLATE_TEMPLATE_PARM can require structural type comparison.
+
 2013-05-24  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/19618
index 903d529abc4a609416d15bb9604a7872cca33ddc..d9a14cc3cbd95c820f0a9e2540ce8b8ba19e6661 100644 (file)
@@ -20367,8 +20367,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;
diff --git a/gcc/testsuite/g++.dg/template/ttp28.C b/gcc/testsuite/g++.dg/template/ttp28.C
new file mode 100644 (file)
index 0000000..a15dea1
--- /dev/null
@@ -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;
+}