]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/89630 - ICE with dependent using-decl as template arg.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Mar 2019 19:37:00 +0000 (19:37 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 18 Mar 2019 19:37:00 +0000 (19:37 +0000)
Even though these two using-declarations have the same effect, they are not
the same declaration, and we don't need to work to treat them as the same
like we do for typedefs.  If we did need to, we would need to handle them
specially in iterative_hash_template_arg as well as here.

* tree.c (cp_tree_equal): Always return false for USING_DECL.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@269777 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/tree.c

index d4dc5d7146aa77f14b2c300768bdfa2d191201db..76bc8ffaa6852bbe9992551c894b3551cf0c5728 100644 (file)
@@ -1,5 +1,8 @@
 2019-03-18  Jason Merrill  <jason@redhat.com>
 
+       PR c++/89630 - ICE with dependent using-decl as template arg.
+       * tree.c (cp_tree_equal): Always return false for USING_DECL.
+
        PR c++/89761 - ICE with sizeof... in pack expansion.
        * pt.c (argument_pack_element_is_expansion_p): Handle
        ARGUMENT_PACK_SELECT.
index af077e795cfba32050da934bf56d0590b17731c4..718eed349c65f7eb78972dade3ebf7467ecb8719 100644 (file)
@@ -3661,6 +3661,7 @@ cp_tree_equal (tree t1, tree t2)
     case TEMPLATE_DECL:
     case IDENTIFIER_NODE:
     case SSA_NAME:
+    case USING_DECL:
       return false;
 
     case BASELINK:
@@ -3787,14 +3788,6 @@ 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;
-
     case LAMBDA_EXPR:
       /* Two lambda-expressions are never considered equivalent.  */
       return false;