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++/86524] [8/9 Regression] std::less with pointer arguments not usable in static_assert in constexpr function


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org,
                   |                            |nathan at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Reduced testcase:
constexpr bool
foo (const int *x, const int *y)
{
  if (__builtin_constant_p (x < y))
    return x < y;
  return (__UINTPTR_TYPE__) x < (__UINTPTR_TYPE__) y;
}

void
bar ()
{
  constexpr int x = 0;
  static_assert (!(&x < &x));
  static_assert (!foo (&x, &x));
}

constexpr void
baz ()
{
  constexpr int x = 0;
  static_assert (!(&x < &x));
  static_assert (!foo (&x, &x));
}

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