diff options
author | Jason Merrill <jason@redhat.com> | 2016-08-11 11:43:12 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2016-08-11 11:43:12 -0400 |
commit | 4200a7231e1ad67dc5476b7b6ab9ea015ccaa65d (patch) | |
tree | 331d5162ca8cdf18e4771b9113a074479d90ba07 /gcc | |
parent | e8283787cbbd0438c8c6199807347ff5addcf522 (diff) | |
download | gcc-4200a7231e1ad67dc5476b7b6ab9ea015ccaa65d.zip gcc-4200a7231e1ad67dc5476b7b6ab9ea015ccaa65d.tar.gz gcc-4200a7231e1ad67dc5476b7b6ab9ea015ccaa65d.tar.bz2 |
PR c++/73456 - ICE with constrained parameter pack.
* logic.cc (non_atomic_constraint_p): Handle EXPR_PACK_EXPANSION.
From-SVN: r239376
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/logic.cc | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/concepts/variadic4.C | 20 |
3 files changed, 28 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 647b3e6..04d6aa0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2016-08-11 Jason Merrill <jason@redhat.com> + + PR c++/73456 + * logic.cc (non_atomic_constraint_p): Handle EXPR_PACK_EXPANSION. + 2016-08-10 Jason Merrill <jason@redhat.com> Implement C++17 constexpr if. diff --git a/gcc/cp/logic.cc b/gcc/cp/logic.cc index dda98df..b86e740 100644 --- a/gcc/cp/logic.cc +++ b/gcc/cp/logic.cc @@ -305,6 +305,9 @@ non_atomic_constraint_p (tree t) case ICONV_CONSTR: case DEDUCT_CONSTR: case EXCEPT_CONSTR: + /* A pack expansion isn't atomic, but it can't decompose to prove an + atom, so it shouldn't cause analyze_atom to return undecided. */ + case EXPR_PACK_EXPANSION: return false; case CHECK_CONSTR: case PARM_CONSTR: diff --git a/gcc/testsuite/g++.dg/concepts/variadic4.C b/gcc/testsuite/g++.dg/concepts/variadic4.C new file mode 100644 index 0000000..d20fa7d --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/variadic4.C @@ -0,0 +1,20 @@ +// PR c++/73456 +// { dg-options "-std=c++1z -fconcepts" } + +template<typename...> struct list {}; + +template<typename Seq> +concept bool Sequence = true; + +template<Sequence... Seqs> +struct zip; + +template<Sequence... Seqs> + requires requires { typename list<Seqs...>; } +// main.cpp:12:8: internal compiler error: in non_atomic_constraint_p, at cp/logic.cc:315 +struct zip<Seqs...> {}; + +int main() +{ + zip<list<>, list<int>> {}; +} |