[v3 PATCH] PR libstdc++/78420

Tim Song t.canens.cpp@gmail.com
Sun Jan 22 16:11:00 GMT 2017


On Sun, Jan 22, 2017 at 10:42 AM, Ville Voutilainen
<ville.voutilainen@gmail.com> wrote:
> +      _GLIBCXX14_CONSTEXPR
> +      bool
> +      operator()(_Tp* __x, _Tp* __y) const
> +      { return uintptr_t(__x) > uintptr_t(__y); }

These reinterpret_casts can't possibly be constexpr.

Simple test case:

#include <functional>

constexpr bool g() {
    int a[10] = {};
    return std::greater<int*>{}(a, a+5);
}

static_assert(!g(), "");



More information about the Gcc-patches mailing list