This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Cleanup non-portable std::any tests
ClosedPublic

Authored by CaseyCarter on Oct 26 2016, 12:51 PM.

Details

Summary

Cleanup nonportable behavior in tests for std::any

Fixes MS issues 63, 64, and 65.

test/std/utilities/any/any.class/any.cons/move.pass.cpp:

  • "Moves are always destructive" is not a portable assumption; check with LIBCPP_ASSERT.

test/std/utilities/any/any.class/any.cons/value.pass.cpp:
test/libcxx/utilities/any/any.class/any.cons/value.pass.cpp:

  • The standard does not forbid initializing std::any from any pointer-to-function type. The DecayTag test is a libc++ extension (at best); factor it out into a test in the libcxx hierarchy.

test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp:

  • Self-swap is not specified to perform no moves; check with LIBCPP_ASSERT.

Diff Detail

Repository
rL LLVM

Event Timeline

CaseyCarter retitled this revision from to [libc++] Cleanup non-portable std::any tests.
CaseyCarter updated this object.
CaseyCarter added reviewers: EricWF, mclow.lists.
CaseyCarter set the repository for this revision to rL LLVM.
CaseyCarter added a subscriber: cfe-commits.
CaseyCarter added inline comments.Oct 26 2016, 12:54 PM
test/libcxx/utilities/any/any.class/any.cons/value.pass.cpp
36 ↗(On Diff #75934)

I'm generously calling this a "libc++ extension." From my interpretation of N4606, LWG2744, and LWG2754, this appears to be a bug.

EricWF accepted this revision.Oct 26 2016, 1:14 PM
EricWF edited edge metadata.
EricWF added inline comments.
test/libcxx/utilities/any/any.class/any.cons/value.pass.cpp
1 ↗(On Diff #75934)

Just kill this test entirely. I'm going to change the behavior shortly.

This revision is now accepted and ready to land.Oct 26 2016, 1:14 PM
CaseyCarter edited edge metadata.
CaseyCarter removed rL LLVM as the repository for this revision.

Cleanup nonportable behavior in tests for std::any

Fixes MS issues 63, 64, and 65.

test/std/utilities/any/any.class/any.cons/move.pass.cpp:

  • "Moves are always destructive" is not a portable assumption; check with LIBCPP_ASSERT.

test/std/utilities/any/any.class/any.cons/value.pass.cpp:

  • The standard does not forbid initializing std::any from any pointer-to-function type. Remove the non-conforming DecayTag test.

test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp:

  • Self-swap is not specified to perform no moves; check with LIBCPP_ASSERT.
CaseyCarter marked 2 inline comments as done.Oct 26 2016, 1:22 PM

DecayTag destroyed.

This revision was automatically updated to reflect the committed changes.
EricWF added inline comments.Oct 26 2016, 1:31 PM
test/libcxx/utilities/any/any.class/any.cons/value.pass.cpp
36 ↗(On Diff #75934)

I agree. I want this to be a diagnostic of some sort. Preferably a static warning because if you've managed to decay the tags your in for a treat.