This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/78420] [5/6/7 Regression] std::less<T*> is not a total order with -O2 enabled
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 23 Jan 2017 21:45:23 +0000
- Subject: [Bug libstdc++/78420] [5/6/7 Regression] std::less<T*> is not a total order with -O2 enabled
- Auto-submitted: auto-generated
- References: <bug-78420-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78420
--- Comment #13 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Ville Voutilainen from comment #11)
> Ah, the plot thickens. Jens Maurer wrote:
>
> "Regarding the std::less<T*> issue, it seems a bug in the standard
> to require that it be constexpr and deliver a total order. After
> all, the addresses of global objects are defined by the linker,
> so it doesn't seem plausible to get a compile-time answer for
> std::less<T*> that is the same as a later run-time answer."
That doesn't make sense to me; you can call a constexpr function with
non-constant arguments and get a non-constant result. There's no requirement
that it give a total order at compile time, is there?