https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78420

--- Comment #18 from Jens Maurer <jens.maurer at gmx dot net> ---
Then you should cheat on [dcl.constexpr] p5 by carving out the nullptr case:

constexpr void less_than(int *p1, int *p2)
{
  if (p1 == nullptr && p2 == nullptr)
    return false;
  return (size_t)p1 < (size_t)p2;
}

This should sidestep [dcl.constexpr] p5, since "less_than(0,0)" seems to be, in
fact, a constant expression.

Reply via email to