This patch fixes 2586. Just tests; NFC.
Details
Details
- Reviewers
mclow.lists EricWF ldionne - Group Reviewers
Restricted Project - Commits
- rG278c00c4ff8b: [libc++] [NFC] Test that correct value category is used in…
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
For the pair section of the issue, I ran into a few problems. The genesis of the problem is the fact that this compiles (and I can't figure out why):
struct Foo { typedef std::allocator<Foo> allocator_type; Foo(std::allocator_arg_t, allocator_type&&) { } Foo(allocator_type&) { } }; int main() { using Alloc1 = std::allocator<pair<Foo, Foo>>; using Alloc2 = std::allocator<Foo>; static_assert( std::is_constructible<Foo, std::allocator_arg_t, Alloc1&>::value); static_assert(!std::is_constructible<Foo, std::allocator_arg_t, Alloc2&>::value); }
Comment Actions
It doesn't compile because Alloc1 is convertible to Alloc2, and when it makes the conversion it can turn into either value category (thanks to Eric for explaining). Anyhow, given that bit of information I do not see how the pair portion of this issue can be tested (or how the change matters for pairs).