]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/78489 - Substitution in wrong order
authorJason Merrill <jason@redhat.com>
Fri, 23 Mar 2018 12:57:09 +0000 (08:57 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 23 Mar 2018 12:57:09 +0000 (08:57 -0400)
PR c++/84489
* pt.c (type_unification_real): Revert last two changes.

From-SVN: r258802

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp0x/alias-decl-63.C [deleted file]
gcc/testsuite/g++.dg/cpp0x/fntmpdefarg7.C [deleted file]

index 527ed0e4adeda9521161c2c81afbf47d10093319..6e1648fb4a94c0a89b3de205f2fb89df598a0073 100644 (file)
@@ -1,3 +1,9 @@
+2018-03-23  Jason Merrill  <jason@redhat.com>
+
+       PR c++/78489 - Substitution in wrong order
+       PR c++/84489
+       * pt.c (type_unification_real): Revert last two changes.
+
 2018-03-09  Jason Merrill  <jason@redhat.com>
 
        PR c++/84785 - ICE with alias template and default targs.
index 423d92c66f465266b86c41565189b78cad14943c..9dbf17ba4d883cc9250f59e250f42d107718e914 100644 (file)
@@ -18602,17 +18602,11 @@ type_unification_real (tree tparms,
          location_t save_loc = input_location;
          if (DECL_P (parm))
            input_location = DECL_SOURCE_LOCATION (parm);
-
-         if (saw_undeduced == 1)
-           ++processing_template_decl;
          arg = tsubst_template_arg (arg, targs, complain, NULL_TREE);
-         if (saw_undeduced == 1)
-           --processing_template_decl;
-
-         if (arg != error_mark_node && !uses_template_parms (arg))
+         if (!uses_template_parms (arg))
            arg = convert_template_argument (parm, arg, targs, complain,
                                             i, NULL_TREE);
-         else if (saw_undeduced == 1)
+         else if (saw_undeduced < 2)
            arg = NULL_TREE;
          else
            arg = error_mark_node;
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-63.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-63.C
deleted file mode 100644 (file)
index 04fb42d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// PR c++/84785
-// { dg-do compile { target c++11 } }
-
-template <typename> struct A;
-template <bool> struct B;
-template <bool B, typename> using enable_if_t = typename B<B>::type;
-template <long> using type_pack_element = int;
-struct variant {
-  variant() {}
-  template <typename Arg, long I = Arg::type::value,
-            typename = type_pack_element<I>, enable_if_t<A<Arg>::value, int>>
-  variant(Arg &&);
-};
-
-struct S {
-  variant var;
-};
-int main() { S s; }
diff --git a/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg7.C b/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg7.C
deleted file mode 100644 (file)
index 636bf1a..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-// PR c++/84489
-// { dg-do compile { target c++11 } }
-
-template <class T = int, T N = T(), bool B = (N >> 1)>
-T f1() {return 0;}
-
-int main()
-{
-  f1(); // Bug here
-}