This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] [test] Improve MSVC portability.
ClosedPublic

Authored by STL_MSFT on Dec 13 2017, 5:20 PM.

Details

Summary

[libcxx] [test] Improve MSVC portability.

test/support/msvc_stdlib_force_include.hpp
When testing MSVC's STL with C1XX, simulate a couple more compiler feature-test macros.

When testing MSVC's STL, simulate a few library feature-test macros.

test/std/atomics/atomics.lockfree/isalwayslockfree.pass.cpp
The vector_size attribute is a non-Standard extension that's supported by Clang and GCC,
but not C1XX. Therefore, guard this with __has_attribute(vector_size).

Additionally, while these tests pass when MSVC's STL is compiled with Clang,
I don't consider this to be a supported scenario for our library,
so also guard this with defined(_LIBCPP_VERSION).

test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
N4713 23.14.10 [func.not_fn]/1 depicts only call_wrapper(call_wrapper&&) = default;
and call_wrapper(const call_wrapper&) = default;. According to
15.8.2 [class.copy.assign]/2 and /4, this makes call_wrapper non-assignable.
Therefore, guard the assignability tests as libc++ specific.

Add a (void) cast to tolerate not_fn() being marked as nodiscard.

Diff Detail

Event Timeline

STL_MSFT created this revision.Dec 13 2017, 5:20 PM

Ping? (And happy new year!)

Ping? (And happy Patch Tuesday!)

According to 15.8.2 [class.copy.assign]/2 and /4, this makes call_wrapper non-assignable.

Then I think we've got a LWG issue, because that's not what I remember the intent to have been.

Investigating the assignability of not_fn. All the rest of this looks fine.

mclow.lists accepted this revision.Jan 9 2018, 2:35 PM
This revision is now accepted and ready to land.Jan 9 2018, 2:35 PM
STL_MSFT closed this revision.Jan 9 2018, 4:43 PM

Thanks, I've checked this in as-is. I would support an LWG issue to change the Standardese here.