This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/68246] New: Incorrect evaluation of C++1z fold expressions (... || expr) in concepts


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]