This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/86524] [8/9 Regression] std::less with pointer arguments not usable in static_assert in constexpr function
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 19 Jul 2018 10:32:35 +0000
- Subject: [Bug c++/86524] [8/9 Regression] std::less with pointer arguments not usable in static_assert in constexpr function
- Auto-submitted: auto-generated
- References: <bug-86524-4@http.gcc.gnu.org/bugzilla/>
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));
}