[libcxx-commits] [PATCH] D112904: [libc++] P0433R2: test that deduction guides are properly SFINAEd away.
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Nov 2 10:18:02 PDT 2021
ldionne accepted this revision.
ldionne added a comment.
LGTM with the `LIBCPP_STATIC_ASSERT` simplification.
================
Comment at: libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/deduct.pass.cpp:291
+#ifdef _LIBCPP_VERSION
+ static_assert(SFINAEs_away<std::priority_queue, OutputIter, OutputIter, Comp>);
+#endif // _LIBCPP_VERSION
----------------
You can replace this by `LIBCPP_STATIC_ASSERT` and avoid the `#ifdef` dance.
================
Comment at: libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/deduct.fail.cpp:9
+
+// UNSUPPORTED: c++03, c++11, c++14
+
----------------
var-const wrote:
> ldionne wrote:
> > Is there a reason why this one isn't based on SFINAE checks like the container tests?
> For containers, the requirement is for deduction guides to `not participate in overload resolution`, but for unique pointers, the requirement is that `If class template argument deduction would select the function template corresponding to this constructor, then the program is ill-formed`. I interpreted `ill-formed` as "resulting in a hard error" -- please let me know if this is incorrect.
Oh, then this is correct. It's a really unusual specification for this kind of failure though.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D112904/new/
https://reviews.llvm.org/D112904
More information about the libcxx-commits
mailing list