From: Jason Merrill Date: Thu, 11 Aug 2016 15:43:12 +0000 (-0400) Subject: PR c++/73456 - ICE with constrained parameter pack. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4200a7231e1ad67dc5476b7b6ab9ea015ccaa65d;p=gcc.git PR c++/73456 - ICE with constrained parameter pack. * logic.cc (non_atomic_constraint_p): Handle EXPR_PACK_EXPANSION. From-SVN: r239376 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 647b3e65800..04d6aa0ccbf 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2016-08-11 Jason Merrill + + PR c++/73456 + * logic.cc (non_atomic_constraint_p): Handle EXPR_PACK_EXPANSION. + 2016-08-10 Jason Merrill Implement C++17 constexpr if. diff --git a/gcc/cp/logic.cc b/gcc/cp/logic.cc index dda98dfc310..b86e740e7c3 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 00000000000..d20fa7da4e5 --- /dev/null +++ b/gcc/testsuite/g++.dg/concepts/variadic4.C @@ -0,0 +1,20 @@ +// PR c++/73456 +// { dg-options "-std=c++1z -fconcepts" } + +template struct list {}; + +template +concept bool Sequence = true; + +template +struct zip; + +template + requires requires { typename list; } +// main.cpp:12:8: internal compiler error: in non_atomic_constraint_p, at cp/logic.cc:315 +struct zip {}; + +int main() +{ + zip, list> {}; +}