[PATCH] D25249: [libc++] Many any test fixes

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 7 14:39:44 PDT 2016


EricWF added a comment.

@CaseyCarter Thank you for the patch. I fixed most of your issues in r283606 {as well as a bunch of libc++ bugs).

I'm still deciding what to do about the `in_place` SFINAE tests, but I'll follow up on that shortly. As for this patch please update it if there are any fixes I missed, otherwise please close it.



================
Comment at: test/libcxx/utilities/any/any.class/any.assign/value.pass.cpp:25
+// Test that any& operator=(ValueType&&) is *never* selected for:
+// * std::in_place type.
+    {
----------------
CaseyCarter wrote:
> This behavior is not required by N4606, so I moved this test to the libcxx tree.
I thought this behavior was subject to a LWG PR, but I can't seem to find one.

I'll either create a LWG issue to standardize this behavior or remove the tests and fix libc++.


================
Comment at: test/libcxx/utilities/any/any.class/any.cons/value.pass.cpp:23
+int main() {
+    // test construction from INSANE copy-but-not-movable types.
+    using Type = deleted_move;
----------------
CaseyCarter wrote:
> Again, not required behavior (I am, of course, totally unbiased about whether this behavior is a good idea.)
I'm removing these tests all together.


================
Comment at: test/libcxx/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp:34
+
+// Test that I can retrieve INSANE copy-but-not-movable type from an any
+void test_cast_to_value_deleted_move()
----------------
CaseyCarter wrote:
> ibid.
I'm removing these tests all together.


================
Comment at: test/std/utilities/any/any.class/any.assign/value.pass.cpp:172
 void test_sfinae_constraints() {
-    {
-        using Tag = std::in_place_type_t<int>;
----------------
CaseyCarter wrote:
> I split out these non-portable tests into test/libcxx/utilities/any.class/any.assign/value.pass.cpp
Same comment as above in regards to the `in_place` SFINAE tests.




================
Comment at: test/std/utilities/any/any.class/any.cons/copy.pass.cpp:74
         assertContains<Type>(a, 42);
-        assertContains<Type>(a, 42);
+        assertContains<Type>(a2, 42);
 
----------------
CaseyCarter wrote:
> Typo in the original test.
Ack. Fixing.


================
Comment at: test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp:146
-        // Check getting a type by reference from a non-const rvalue
-        {
-            Type& v = any_cast<Type&>(std::move(a));
----------------
CaseyCarter wrote:
> This code becomes ill-formed with the above proposed change.
I'm removing these tests.


https://reviews.llvm.org/D25249





More information about the cfe-commits mailing list