re PR c++/85976 (ICE in cp_tree_equal when building Blitz. May be nested templates.)
authorMarek Polacek <polacek@redhat.com>
Tue, 5 Jun 2018 13:11:00 +0000 (13:11 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Tue, 5 Jun 2018 13:11:00 +0000 (13:11 +0000)
PR c++/85976
* tree.c (cp_tree_equal): Handle USING_DECL.

* g++.dg/cpp0x/alias-decl-64.C: New test.

From-SVN: r261200

gcc/cp/ChangeLog
gcc/cp/tree.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/alias-decl-64.C [new file with mode: 0644]

index f4fa21a7a9782422926d9bb3954825edab4a750a..4962eacf5fc56557c1a6074bb718cfc9f7b6b413 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-05  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/85976
+       * tree.c (cp_tree_equal): Handle USING_DECL.
+
 2018-06-05  Jason Merrill  <jason@redhat.com>
 
        PR c++/85731 - wrong error with qualified-id in template.
index c5b6e9689b68739f89d6459ea328c6fad7088890..bbbda7e98b60d850f66f1037ba1d8c84897ad281 100644 (file)
@@ -3878,6 +3878,14 @@ cp_tree_equal (tree t1, tree t2)
                                     DEFERRED_NOEXCEPT_ARGS (t2)));
       break;
 
+    case USING_DECL:
+      if (DECL_DEPENDENT_P (t1) && DECL_DEPENDENT_P (t2))
+       return (cp_tree_equal (USING_DECL_SCOPE (t1),
+                              USING_DECL_SCOPE (t2))
+               && cp_tree_equal (DECL_NAME (t1),
+                                 DECL_NAME (t2)));
+      return false;
+
     default:
       break;
     }
index 2cacaa2931de1cce6b65ba4a7372f99cea68dc97..a049d14e886a47752a93663eb3e0dcf232d4cb1f 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-05  Marek Polacek  <polacek@redhat.com>
+
+       PR c++/85976
+       * g++.dg/cpp0x/alias-decl-64.C: New test.
+
 2018-06-05  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/86046
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-64.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-64.C
new file mode 100644 (file)
index 0000000..019eb26
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/85976
+// { dg-do compile { target c++11 } }
+
+template <int> class A;
+template <typename> class B;
+template <typename> struct C;
+template <typename P_expr> class D {
+  using B<typename P_expr::T_numtype>::rank_;
+  void operator()(typename C<A<rank_>>::i);
+};
+
+template <typename P_expr> class F {
+  using B<typename P_expr::T_numtype>::rank_;
+  void operator()(typename C<A<rank_>>::i);
+};