[Bug libstdc++/78420] [5/6/7 Regression] std::less<T*> is not a total order with -O2 enabled
ville.voutilainen at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Jan 23 22:00:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78420
--- Comment #14 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
Not in general, no, it doesn't have to always give a compile-time answer. But I
believe the library intent is that when it compares compile-time constant
pointers, it should give that answer at compile-time, and it should be a toral
order. What seems to be suggested by that comment is that since it's possible
to compare compile-time constant pointers and run-time values with this
function, and it can't know (definition-wise) whether the incoming arguments
are constants or not, we could just as well drop the constexpr completely from
the pointer specialization of std::less, as that will then open the door to
simply reinterpret_cast in it. None of that has been confirmed by LWG, though.
More information about the Gcc-bugs
mailing list