This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] removes operator!= and globally guards against no spaceship operator
ClosedPublic

Authored by cjdb on Apr 12 2021, 2:05 PM.

Details

Summary
  • operator!= isn't in the spec
  • <compare> is designed to work with operator<=> so it doesn't really make sense to have operator<=>-less friendly sections.

Depends on D100283.

Diff Detail

Event Timeline

cjdb created this revision.Apr 12 2021, 2:05 PM
cjdb requested review of this revision.Apr 12 2021, 2:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 12 2021, 2:05 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Apr 12 2021, 2:16 PM

LGTM. I assume we didn't have tests that would need changing?

This revision is now accepted and ready to land.Apr 12 2021, 2:16 PM
Quuxplusone accepted this revision.Apr 12 2021, 3:00 PM
Quuxplusone added a subscriber: Quuxplusone.

This seems like a step in the right direction. Would you be interested in jumping all the way to the full C++20-mandated hidden-friend implementation in one fell swoop? Or is that already on your roadmap?

cppreference says:

These functions are not visible to ordinary unqualified or qualified lookup, and can only be found by argument-dependent lookup when std::partial_ordering [or whatever] is an associated class of the arguments.

In other words, they should be defined inline, as hidden friends.

cjdb updated this revision to Diff 342199.May 1 2021, 9:01 PM

rebases to activate CI

cjdb updated this revision to Diff 344113.May 10 2021, 10:33 AM

rebases to activate CI

cjdb updated this revision to Diff 344228.May 10 2021, 4:06 PM

adds // UNSUPPORTED: apple-clang-9, apple-clang-10, apple-clang-11, apple-clang-12.0.0 to the files failing CI (AppleClang <12.0.1 seems to not work)