aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2018-02-26 00:05:15 -0500
committerJason Merrill <jason@gcc.gnu.org>2018-02-26 00:05:15 -0500
commita8a3f32d583d9fde8e94c11c118c47c702bdea04 (patch)
tree1aa9d007377f72ef4bdf4537ac445d12d0953e00
parent9445efc2207663c7c309ba0081411d7a6b966bc8 (diff)
downloadgcc-a8a3f32d583d9fde8e94c11c118c47c702bdea04.zip
gcc-a8a3f32d583d9fde8e94c11c118c47c702bdea04.tar.gz
gcc-a8a3f32d583d9fde8e94c11c118c47c702bdea04.tar.bz2
PR c++/84015 - ICE with class deduction and auto template parm.
* pt.c (rewrite_template_parm): Use tf_partial in first tsubst. From-SVN: r257979
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c2
-rw-r--r--gcc/testsuite/g++.dg/cpp1z/class-deduction49.C15
3 files changed, 21 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 3d4c946..cb0dcd7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2018-02-25 Jason Merrill <jason@redhat.com>
+
+ PR c++/84015 - ICE with class deduction and auto template parm.
+ * pt.c (rewrite_template_parm): Use tf_partial in first tsubst.
+
2018-02-24 Marek Polacek <polacek@redhat.com>
PR c++/83692
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 85d1adb..9cf96e9 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -25596,7 +25596,7 @@ rewrite_template_parm (tree olddecl, unsigned index, unsigned level,
// Substitute ttargs into ttparms to fix references to
// other template parameters.
ttparms = tsubst_template_parms_level (ttparms, ttargs,
- complain);
+ complain|tf_partial);
// Now substitute again with args based on tparms, to reduce
// the level of the ttparms.
ttargs = current_template_args ();
diff --git a/gcc/testsuite/g++.dg/cpp1z/class-deduction49.C b/gcc/testsuite/g++.dg/cpp1z/class-deduction49.C
new file mode 100644
index 0000000..086f12a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1z/class-deduction49.C
@@ -0,0 +1,15 @@
+// PR c++/84015
+// { dg-additional-options -std=c++17 }
+
+template <int I>
+struct A { };
+
+template <int I>
+struct B
+{
+ template<template<auto>class T>
+ B(T<I>);
+};
+
+A<42> a;
+B b (a);