This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Use addressof in unordered_set.
ClosedPublic

Authored by Mordante on Jan 21 2022, 12:01 PM.

Details

Reviewers
philnik
Quuxplusone
Group Reviewers
Restricted Project
Commits
rG26544b98f7bf: [libc++] Use addressof in unordered_set.
Summary

This addresses the usage of operator& in <unordered_set>.

(Note there are still more headers with the same issue.)

Diff Detail

Event Timeline

Mordante requested review of this revision.Jan 21 2022, 12:01 PM
Mordante created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 21 2022, 12:01 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
philnik accepted this revision.Jan 21 2022, 12:14 PM
This revision is now accepted and ready to land.Jan 21 2022, 12:14 PM
Quuxplusone accepted this revision.Jan 21 2022, 12:29 PM
Quuxplusone added a subscriber: Quuxplusone.

LGTM if CI is green!

libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.addressof.compile.pass.cpp
9

This line can be removed, can't it?
(Ditto throughout, probably. Please investigate each UNSUPPORTED and remove the ones that can be removed.)

libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.addressof.compile.pass.cpp
26–32

This is good just for extra test coverage, but FWIW/FYI, I'm pretty sure you could have just done something like

std::unordered_multiset<operator_hijacker> so;
std::unordered_multiset<operator_hijacker> s(std::move(so), so.get_allocator());

without all the extra params.

Mordante marked 2 inline comments as done.Jan 22 2022, 2:40 AM
Mordante added inline comments.
libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.addressof.compile.pass.cpp
9

No this constructor is only available in C++11 in our implementation.

libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.addressof.compile.pass.cpp
26–32

Yes that would have been possible.

This revision was automatically updated to reflect the committed changes.
Mordante marked 2 inline comments as done.