[libc++] P0433R2: test that deduction guides are properly SFINAEd away.
authorKonstantin Varlamov <varconst@apple.com>
Tue, 9 Nov 2021 17:21:02 +0000 (09:21 -0800)
committerKonstantin Varlamov <varconst@apple.com>
Tue, 9 Nov 2021 17:32:24 +0000 (09:32 -0800)
commit68072a71662a7955b65a761b8e36a5ef6d38186a
treeeca5d1aeb6861d1273870d34592ae4b61ead6fa4
parent8619212b94994df7d5bedda2d6dfca5a439b3eaa
[libc++] P0433R2: test that deduction guides are properly SFINAEd away.

Deduction guides for containers should not participate in overload
resolution when called with certain incorrect types (e.g. when called
with a template argument in place of an `InputIterator` that doesn't
qualify as an input iterator). Similarly, class template argument
deduction should not select `unique_ptr` constructors that take a
a pointer.

The tests try out every possible incorrect parameter (but never more
than one incorrect parameter in the same invocation).

Also add deduction guides to the synopsis for associative and unordered
containers (this was accidentally omitted from [D112510](https://reviews.llvm.org/D112510)).

Differential Revision: https://reviews.llvm.org/D112904
29 files changed:
libcxx/docs/Status/Cxx17.rst
libcxx/docs/Status/Cxx17Papers.csv
libcxx/include/__memory/allocator_traits.h
libcxx/include/deque
libcxx/include/forward_list
libcxx/include/list
libcxx/include/map
libcxx/include/queue
libcxx/include/set
libcxx/include/unordered_map
libcxx/include/unordered_set
libcxx/include/vector
libcxx/test/std/containers/associative/map/map.cons/deduct.pass.cpp
libcxx/test/std/containers/associative/multimap/multimap.cons/deduct.pass.cpp
libcxx/test/std/containers/associative/multiset/multiset.cons/deduct.pass.cpp
libcxx/test/std/containers/associative/set/set.cons/deduct.pass.cpp
libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp
libcxx/test/std/containers/container.adaptors/queue/queue.cons/deduct.pass.cpp
libcxx/test/std/containers/container.adaptors/stack/stack.cons/deduct.pass.cpp
libcxx/test/std/containers/sequences/deque/deque.cons/deduct.pass.cpp
libcxx/test/std/containers/sequences/forwardlist/forwardlist.cons/deduct.pass.cpp
libcxx/test/std/containers/sequences/list/list.cons/deduct.pass.cpp
libcxx/test/std/containers/sequences/vector/vector.cons/deduct.pass.cpp
libcxx/test/std/containers/unord/unord.map/unord.map.cnstr/deduct.pass.cpp
libcxx/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/deduct.pass.cpp
libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/deduct.pass.cpp
libcxx/test/std/containers/unord/unord.set/unord.set.cnstr/deduct.pass.cpp
libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/deduct.pass.cpp [new file with mode: 0644]
libcxx/test/support/deduction_guides_sfinae_checks.h [new file with mode: 0644]