This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Implement `thread::id` comparators as free functions
ClosedPublic

Authored by avogelsgesang on Aug 8 2022, 1:10 PM.

Details

Summary

So far, the thread::id comparators were implemented as hidden friends.
This was non-conforming and lead to incorrectly rejected C++ code, as
can be seen in the linked Github issue.

Fixes https://github.com/llvm/llvm-project/issues/56187

Diff Detail

Event Timeline

avogelsgesang created this revision.Aug 8 2022, 1:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 1:10 PM
avogelsgesang requested review of this revision.Aug 8 2022, 1:10 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 1:10 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript

use correct visibility macros

Thanks for fixing this bug!
Can you mention this change to the API changes of the release documentation?

libcxx/include/__threading_support
619

Is there a reason to make all 6 of them friends? I would only operator== and operator< to be a friend.

libcxx/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/eq.pass.cpp
36

Nice!

avogelsgesang marked an inline comment as done.

address comments

Can you mention this change to the API changes of the release documentation?

Afaict, there is no "API changes" in the release notes, only "ABI changes". I added the item to the "Improvements" section instead

Mordante accepted this revision.Aug 10 2022, 10:54 AM

Can you mention this change to the API changes of the release documentation?

Afaict, there is no "API changes" in the release notes, only "ABI changes". I added the item to the "Improvements" section instead

We used to have an API section, for example https://releases.llvm.org/14.0.0/projects/libcxx/docs/ReleaseNotes.html#api-changes

Can you re-add that section and move the new documentation there?

LGTM after moving the documentation.

This revision is now accepted and ready to land.Aug 10 2022, 10:54 AM

Introduce "API changes" section and move description of this change there

This revision was landed with ongoing or failed builds.Aug 10 2022, 11:41 AM
This revision was automatically updated to reflect the committed changes.