diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-26 06:09:01 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2018-02-26 06:09:01 +0000 |
commit | 14e2c3280812026901d01c957807159148336557 (patch) | |
tree | f7d21e2ab9f2fc189dabd9bc08d69450876b3756 | |
parent | bf3ce93df01c674a33160fde8c033034feb5d8c4 (diff) | |
download | gcc-14e2c3280812026901d01c957807159148336557.tar.gz |
PR c++/84015 - ICE with class deduction and auto template parm.
* pt.c (rewrite_template_parm): Use tf_partial in first tsubst.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-7-branch@257980 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp1z/class-deduction49.C | 15 |
3 files changed, 21 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 48f75d9bf1f..2735b26c08e 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-19 Jonathan Wakely <jwakely@redhat.com> Backport from mainline diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 7478909d6cc..870d0f8eb5d 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -25150,7 +25150,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 00000000000..086f12ad3c6 --- /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); |