From: Jason Merrill Date: Fri, 23 Mar 2018 12:57:09 +0000 (-0400) Subject: PR c++/78489 - Substitution in wrong order X-Git-Tag: releases/gcc-6.5.0~425 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=554add142ef75ff6f032040ea4743f05ccfb442a;p=thirdparty%2Fgcc.git PR c++/78489 - Substitution in wrong order PR c++/84489 * pt.c (type_unification_real): Revert last two changes. From-SVN: r258802 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 527ed0e4aded..6e1648fb4a94 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-03-23 Jason Merrill + + PR c++/78489 - Substitution in wrong order + PR c++/84489 + * pt.c (type_unification_real): Revert last two changes. + 2018-03-09 Jason Merrill PR c++/84785 - ICE with alias template and default targs. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 423d92c66f46..9dbf17ba4d88 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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 index 04fb42d9e091..000000000000 --- a/gcc/testsuite/g++.dg/cpp0x/alias-decl-63.C +++ /dev/null @@ -1,18 +0,0 @@ -// PR c++/84785 -// { dg-do compile { target c++11 } } - -template struct A; -template struct B; -template using enable_if_t = typename B::type; -template using type_pack_element = int; -struct variant { - variant() {} - template , enable_if_t::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 index 636bf1afd883..000000000000 --- a/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg7.C +++ /dev/null @@ -1,10 +0,0 @@ -// PR c++/84489 -// { dg-do compile { target c++11 } } - -template > 1)> -T f1() {return 0;} - -int main() -{ - f1(); // Bug here -}