This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/68246] New: Incorrect evaluation of C++1z fold expressions (... || expr) in concepts
- From: "richardpku at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 08 Nov 2015 02:11:01 +0000
- Subject: [Bug c++/68246] New: Incorrect evaluation of C++1z fold expressions (... || expr) in concepts
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68246
Bug ID: 68246
Summary: Incorrect evaluation of C++1z fold expressions (... ||
expr) in concepts
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: richardpku at gmail dot com
Target Milestone: ---
template <int... x> concept bool A_concept = (... || (x < 0));
template <int... x> constexpr bool A_constexpr = (... || (x < 0));
static_assert(A_concept<-1, 1>); // This assertion fails, while it should not
static_assert(A_constexpr<-1, 1>); // OK.
Both static assertions should not fail.
It appears "&&" doesn't has this problem:
template <int... x> concept bool B_concept = (... && (x < 0));
template <int... x> constexpr bool B_constexpr = (... && (x < 0));
static_assert(B_concept<-1, -1>); // OK
static_assert(B_constexpr<-1, -1>); // OK