|
|
726b1e |
commit 0ff050a998827c27f216c373331d643b7875d5a7
|
|
|
726b1e |
Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
|
|
|
726b1e |
Date: Sat Mar 10 03:35:17 2018 +0000
|
|
|
726b1e |
|
|
|
726b1e |
PR c++/84785 - ICE with alias template and default targs.
|
|
|
726b1e |
|
|
|
726b1e |
* pt.c (type_unification_real): Set processing_template_decl if
|
|
|
726b1e |
saw_undeduced == 1.
|
|
|
726b1e |
|
|
|
726b1e |
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@258409 138bc75d-0d04-0410-961f-82ee72b054a4
|
|
|
726b1e |
|
|
|
726b1e |
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
|
|
|
726b1e |
index 9815df63c28..b4032550849 100644
|
|
|
726b1e |
--- a/gcc/cp/pt.c
|
|
|
726b1e |
+++ b/gcc/cp/pt.c
|
|
|
726b1e |
@@ -19490,7 +19490,13 @@ type_unification_real (tree tparms,
|
|
|
726b1e |
location_t save_loc = input_location;
|
|
|
726b1e |
if (DECL_P (parm))
|
|
|
726b1e |
input_location = DECL_SOURCE_LOCATION (parm);
|
|
|
726b1e |
+
|
|
|
726b1e |
+ if (saw_undeduced == 1)
|
|
|
726b1e |
+ ++processing_template_decl;
|
|
|
726b1e |
arg = tsubst_template_arg (arg, full_targs, complain, NULL_TREE);
|
|
|
726b1e |
+ if (saw_undeduced == 1)
|
|
|
726b1e |
+ --processing_template_decl;
|
|
|
726b1e |
+
|
|
|
726b1e |
if (arg != error_mark_node && !uses_template_parms (arg))
|
|
|
726b1e |
arg = convert_template_argument (parm, arg, full_targs, complain,
|
|
|
726b1e |
i, NULL_TREE);
|
|
|
726b1e |
diff --git a/gcc/testsuite/g++.dg/cpp0x/alias-decl-63.C b/gcc/testsuite/g++.dg/cpp0x/alias-decl-63.C
|
|
|
726b1e |
new file mode 100644
|
|
|
726b1e |
index 00000000000..04fb42d9e09
|
|
|
726b1e |
--- /dev/null
|
|
|
726b1e |
+++ b/gcc/testsuite/g++.dg/cpp0x/alias-decl-63.C
|
|
|
726b1e |
@@ -0,0 +1,18 @@
|
|
|
726b1e |
+// PR c++/84785
|
|
|
726b1e |
+// { dg-do compile { target c++11 } }
|
|
|
726b1e |
+
|
|
|
726b1e |
+template <typename> struct A;
|
|
|
726b1e |
+template <bool> struct B;
|
|
|
726b1e |
+template <bool B, typename> using enable_if_t = typename B::type;
|
|
|
726b1e |
+template <long> using type_pack_element = int;
|
|
|
726b1e |
+struct variant {
|
|
|
726b1e |
+ variant() {}
|
|
|
726b1e |
+ template
|
|
|
726b1e |
+ typename = type_pack_element, enable_if_t<A<Arg>::value, int>>
|
|
|
726b1e |
+ variant(Arg &&);
|
|
|
726b1e |
+};
|
|
|
726b1e |
+
|
|
|
726b1e |
+struct S {
|
|
|
726b1e |
+ variant var;
|
|
|
726b1e |
+};
|
|
|
726b1e |
+int main() { S s; }
|