diff options
author | Jason Merrill <jason@redhat.com> | 2018-04-04 15:19:34 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-04-04 15:19:34 -0400 |
commit | 001db6cf52711f785459558508ca6fa97e10bcae (patch) | |
tree | bb89ebc44f8ea8f5cb643ab6b3af74a4d11807bb /gcc | |
parent | 8859913ea3cbefdcf1aaec654744a358420d8138 (diff) | |
download | gcc-001db6cf52711f785459558508ca6fa97e10bcae.zip gcc-001db6cf52711f785459558508ca6fa97e10bcae.tar.gz gcc-001db6cf52711f785459558508ca6fa97e10bcae.tar.bz2 |
PR c++/85006 - -fconcepts ICE with A<auto...> return type
* pt.c (tsubst_pack_expansion): Allow unsubstituted auto pack.
From-SVN: r259100
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/concepts/auto4.C | 11 |
3 files changed, 15 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 12d0c10..04670a3 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2018-04-04 Jason Merrill <jason@redhat.com> + PR c++/85006 - -fconcepts ICE with A<auto...> return type + * pt.c (tsubst_pack_expansion): Allow unsubstituted auto pack. + PR c++/85200 - ICE with constexpr if in generic lambda. * tree.c (cp_walk_subtrees): Walk into DECL_EXPR in templates. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 80670a4..dbbc766 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11860,7 +11860,7 @@ tsubst_pack_expansion (tree t, tree args, tsubst_flags_t complain, /* We can't substitute for this parameter pack. We use a flag as well as the missing_level counter because function parameter packs don't have a level. */ - gcc_assert (processing_template_decl); + gcc_assert (processing_template_decl || is_auto (parm_pack)); unsubstituted_packs = true; } } diff --git a/gcc/testsuite/g++.dg/concepts/auto4.C b/gcc/testsuite/g++.dg/concepts/auto4.C new file mode 100644 index 0000000..e80341e --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/auto4.C @@ -0,0 +1,11 @@ +// PR c++/85006 +// { dg-additional-options "-std=c++17 -fconcepts" } + +template<typename... Ts> struct A {}; + +template<typename... Us> A<auto...> foo() { return A{}; } + +void bar() +{ + foo(); +} |