[Bug libstdc++/106802] New: Comparators in <functional> don't work with orderings in <compare>
aaron at aarongraham dot com
gcc-bugzilla@gcc.gnu.org
Thu Sep 1 16:25:08 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106802
Bug ID: 106802
Summary: Comparators in <functional> don't work with orderings
in <compare>
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: aaron at aarongraham dot com
Target Milestone: ---
gcc does not allow this to compile:
std::less<>{}(std::strong_ordering::less, 0);
Even though `std::strong_ordering::less < 0` is perfectly legal and
well-formed.
It will compile this (but clang will not):
std::less<>{}(std::strong_ordering::less, nullptr);
Godbolt link: https://gcc.godbolt.org/z/9ed16KbhP
More information about the Gcc-bugs
mailing list