This is an archive of the discontinued LLVM Phabricator instance.

[libc++][test] cleanup some small test issues
ClosedPublic

Authored by CaseyCarter on May 15 2020, 1:30 PM.

Details

Reviewers
ldionne
EricWF
mclow.lists
Group Reviewers
Restricted Project
Commits
rG634a0acb307d: Cleanup some test issues:
Summary
  • improve coverage in span's "conversion from std::array" test, while eliminating MSVC diagnostics about testConstructorArray<T>() && testConstructorArray<const T, T>() being redundant when T is already const.
  • Don't test use of is_assignable that triggers UB due to an insufficiently-complete type argument in std::function's assignment operator test on non-libc++. (Honestly, my preference would be to remove this.)
  • Don't test that shared_ptr initialization from an rvalue triggers the lvalue aliasing constructor on non-libc++; this is not the case for Standard Libraries that implement LWG-2996. (Ditto, I'd simply remove this but it's your library ;).)

Diff Detail

Event Timeline

CaseyCarter created this revision.May 15 2020, 1:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 15 2020, 1:30 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne added inline comments.May 15 2020, 2:05 PM
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp
135–136

Sorry if I'm being slow, but can you explain why that's UB?

CaseyCarter marked an inline comment as done.May 15 2020, 2:23 PM
CaseyCarter added inline comments.
libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp
135–136

Sure! F2 is incomplete, and is_assignable<F1&, F2&&>::value could yield a different result if F2 were completed - say if F2has a conversion operator to F1& - which is undefined per [meta.reqmts]/5.

ldionne accepted this revision.May 15 2020, 2:44 PM

Ship it with the is_assignable test removed. Thanks!

libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/F_assign.pass.cpp
135–136

Oh. It's incomplete cause we don't define std::function<R(Args...)&&>. Of course. It makes sense to remove this IMO.

This revision is now accepted and ready to land.May 15 2020, 2:44 PM
This revision was automatically updated to reflect the committed changes.