Commit Graph

298 Commits

Author SHA1 Message Date
Eric Fiselier
40a29e79c2 LWG 2969 "polymorphic_allocator::construct() shouldn't pass resource()"
Patch from Arthur O'Dwyer.

In the TS, `uses_allocator` construction for `pair` tried to use an allocator
type of `memory_resource*`, which is incorrect because `memory_resource*` is
not an allocator type. LWG 2969 fixed it to use `polymorphic_allocator` as the
allocator type instead.

https://wg21.link/lwg2969

(D47090 included this in `<memory_resource>`; at Eric's request, I've split
this out into its own patch applied to the existing
`<experimental/memory_resource>` instead.)

Reviewed as https://reviews.llvm.org/D47109


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@333384 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-29 00:08:47 +00:00
Stephan T. Lavavej
082d5bd7c6 [libcxx] [test] Update msvc_stdlib_force_include.hpp.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@332159 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-11 23:57:32 +00:00
Stephan T. Lavavej
8a869d0f42 [libcxx] [test] Avoid unary_function.
Replace unary_function inheritance (which was never required,
even in C++98) with argument_type and result_type typedefs.
This increases portability, as unary_function was removed in C++17
and MSVC has implemented that removal.

Fixes D45596.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329974 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-12 23:56:10 +00:00
Eric Fiselier
24258c4417 Implement P0768r1: Library support for the Spaceship Operator.
this patch adds the <compare> header and implements all of it
except for [comp.alg].

As I understand it, the header is needed by the compiler in
when implementing the semantics of operator<=>. For that reason
I feel it's important to land this header early, despite
all compilers lacking support.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329460 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-06 21:37:23 +00:00
Eric Fiselier
1e34c76d33 Implement filesystem NB comments, relative paths, and related issues.
This is a fairly large patch that implements all of the filesystem NB comments
and the relative paths changes (ex. adding weakly_canonical). These issues
and papers are all interrelated so their implementation couldn't be split up
nicely.

This patch upgrades <experimental/filesystem> to match the C++17 spec and not
the published experimental TS spec. Some of the changes in this patch are both
API and ABI breaking, however libc++ makes no guarantee about stability for
experimental implementations.

The major changes in this patch are:

* Implement NB comments for filesystem (P0492R2), including:
  * Implement `perm_options` enum as part of NB comments, and update the
    `permissions` function to match.
  * Implement changes to `remove_filename` and `replace_filename`
  * Implement changes to `path::stem()` and `path::extension()` which support
    splitting examples like `.profile`.
  * Change path iteration to return an empty path instead of '.' for trailing
    separators.
  * Change `operator/=` to handle absolute paths on the RHS.
  * Change `absolute` to no longer accept a current path argument.

* Implement relative paths according to NB comments (P0219r1)

* Combine `path.cpp` and `operations.cpp` since some path functions require
  access to the operations internals, and some fs operations require access
  to the path parser.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@329028 91177308-0d34-0410-b5e6-96231b3b80d8
2018-04-02 23:03:41 +00:00
Eric Fiselier
f1471a367b Make filesystem tests generic between experimental and std versions.
As I move towards implementing std::filesystem, there is a need to
make the existing tests run against both the std and experimental versions.
Additionally, it's helpful to allow running the tests against other
implementations of filesystem.

This patch converts the test to easily target either. First, it
adds a filesystem_include.hpp header which is soley responsible
for selecting and including the correct implementation. Second,
it converts existing tests to use this header instead of including
filesystem directly.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328475 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-26 05:46:57 +00:00
Eric Fiselier
b06c8f07b2 Use DoNotOptimize to prevent new/delete elision.
The new/delete tests, in particular those which test replacement
functions, often fail when the optimizer is enabled because the
calls to new/delete may be optimized away, regardless of their side-effects.

This patch converts the tests to use DoNotOptimize in order to prevent
the elision.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328245 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 21:28:09 +00:00
Eric Fiselier
6d7a11eb53 Correct TEST_HAS_NO_ALIGNED_ALLOCATION macro definition
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328185 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 06:21:07 +00:00
Eric Fiselier
a831287399 Fix PR22634 - std::allocator doesn't respect over-aligned types.
This patch fixes std::allocator, and more specifically, all users
of __libcpp_allocate and __libcpp_deallocate, to support over-aligned
types.

__libcpp_allocate/deallocate now take an alignment parameter, and when
the specified alignment is greater than that supported by malloc/new,
the aligned version of operator new is called (assuming it's available).

When aligned new isn't available, the old behavior has been kept, and the
alignment parameter is ignored.

This patch depends on recent changes to __builtin_operator_new/delete which
allow them to be used to call any regular new/delete operator. By using
__builtin_operator_new/delete when possible, the new/delete erasure optimization
is maintained.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@328180 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 04:42:56 +00:00
Peter Collingbourne
f493c2fed6 libcxx: Provide overloads for basic_filebuf::open() et al that take wchar_t* filenames on Windows.
This is an MSVC standard library extension. It seems like a reasonable
enough extension to me because wchar_t* is the native format for
filenames on that platform.

Differential Revision: https://reviews.llvm.org/D42225

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@323170 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-23 02:07:27 +00:00
Stephan T. Lavavej
4ffbed58e9 [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.

Fixes D41213.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@322144 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-10 00:39:46 +00:00
Billy Robert O'Neal III
4dd943ec8e Move + and * operators of MoveOnly into MoveOnly.h.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@321852 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 01:32:00 +00:00
Stephan T. Lavavej
dd2a900c0b [libcxx] [test] Fix MSVC warnings, null pointer deref.
test/std/algorithms/alg.modifying.operations/alg.generate/generate_n.pass.cpp
Silence MSVC warning C4244. This is expected when passing
floating-point values for size.

test/std/utilities/template.bitset/bitset.members/to_ullong.pass.cpp
test/std/utilities/template.bitset/bitset.members/to_ulong.pass.cpp
Avoid MSVC "warning C4293: '<<': shift count negative or too big,
undefined behavior". MSVC sees (1ULL << N) and warns - being guarded
by const bool canFit is insufficient. A small change to the code
avoids the warning without the need for a pragma.

Remove a spurious printf() declaration from to_ullong.pass.cpp.

Change ULL to UL in to_ulong.pass.cpp. The ULL suffix was
probably copy-pasted.

test/std/utilities/tuple/tuple.general/ignore.pass.cpp
Use LIBCPP_STATIC_ASSERT for consistency with other files.

test/support/container_test_types.h
Fix a null pointer dereference, found by MSVC /analyze
warning C6011 "Dereferencing NULL pointer 'm_expected_args'."

Fixes D41030.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@320535 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 00:51:27 +00:00
Billy Robert O'Neal III
7e250fcdc1 Change (void) casts to TEST_IGNORE_NODISCARD, as requested by Eric. Reviewed as https://reviews.llvm.org/D40065
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318804 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-21 21:37:26 +00:00
Alexander Richardson
e208d0895a Rename identifiers named __output
Summary:
In the CHERI clang compiler __output and __input are keywords and therefore
we can't compile libc++ with our compiler.

Reviewers: mclow.lists, EricWF, theraven

Reviewed By: EricWF

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D39537

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@318144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-14 11:14:25 +00:00
Eric Fiselier
9fdd86763e fix shadowing warnings in new tests, try 2
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@316009 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 16:06:42 +00:00
Eric Fiselier
d93991fedd fix shadowing warnings in new tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315997 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 13:45:20 +00:00
Eric Fiselier
94c3917960 [libc++] Fix PR34898 - vector iterator constructors and assign method perform push_back instead of emplace_back.
Summary:
The constructors `vector(Iter, Iter, Alloc = Alloc{})` and `assign(Iter, Iter)` don't correctly perform EmplaceConstruction from the result of dereferencing the iterator. This results in them performing an additional and unneeded copy.

This patch addresses the issue by correctly using `emplace_back` in C++11 and newer.

There are also some bugs in our `insert` implementation, but those will be handled separately. 

@mclow.lists We should probably merge this into 5.1, agreed?

Reviewers: mclow.lists, dlj, EricWF

Reviewed By: mclow.lists, EricWF

Subscribers: cfe-commits, mclow.lists

Differential Revision: https://reviews.llvm.org/D38757

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@315994 91177308-0d34-0410-b5e6-96231b3b80d8
2017-10-17 13:03:17 +00:00
Stephan T. Lavavej
7f0fd06bf7 [libcxx] [test] Silence warning C4324 for MSVC.
This warning "structure was padded due to alignment specifier" says
that the compiler is going to do exactly what you asked it to do.
It's triggered by the tests for over-aligned dynamic memory allocation.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@314257 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-26 23:08:39 +00:00
Stephan T. Lavavej
e8c8bc9433 [libcxx] [test] Update for C++17 feature removals.
test/std/containers/Emplaceable.h
test/std/containers/NotConstructible.h
test/support/counting_predicates.hpp
Replace unary_function/binary_function inheritance with typedefs.

test/std/depr/depr.function.objects/depr.base/binary_function.pass.cpp
test/std/depr/depr.function.objects/depr.base/unary_function.pass.cpp
test/std/utilities/function.objects/func.require/binary_function.pass.cpp
test/std/utilities/function.objects/func.require/unary_function.pass.cpp
Mark these tests as requiring 98/03/11/14 because 17 removed unary_function/binary_function.

test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp
test/std/thread/futures/futures.task/futures.task.nonmembers/uses_allocator.pass.cpp
Mark these tests as requiring 11/14 because 17 removed packaged_task allocator support.

test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.pass.cpp
This test doesn't need to be skipped in C++17 mode. Only the construction of
std::function from an allocator needs to be skipped in C++17 mode.

test/std/utilities/function.objects/refwrap/refwrap.access/conversion.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.assign/copy_assign.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.const/copy_ctor.pass.cpp
test/std/utilities/function.objects/refwrap/refwrap.const/type_ctor.pass.cpp
When testing these reference_wrapper features, unary_function inheritance is totally irrelevant.

test/std/utilities/function.objects/refwrap/weak_result.pass.cpp
Define and use my_unary_function/my_binary_function to test the weak result type machinery
(which is still present in C++17, although deprecated).

test/support/msvc_stdlib_force_include.hpp
Now we can test C++17 strictly, without enabling removed features.

Fixes D36503.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@311705 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-24 21:24:08 +00:00
Stephan T. Lavavej
302557b724 [libcxx] [test] Rename _Tp to T. NFCI.
This improves readability and (theoretically) improves portability,
as _Ugly names are reserved.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@310758 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-11 20:53:53 +00:00
Stephan T. Lavavej
6f13bfd436 [libcxx] [test] Fix URLs in comments and make them HTTPS. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@310156 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-05 00:44:24 +00:00
Stephan T. Lavavej
25072f0004 [libcxx] [test] Make files consistently end with newlines, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309465 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 00:55:22 +00:00
Stephan T. Lavavej
a686caad20 [libcxx] [test] Untabify, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309464 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 00:55:10 +00:00
Stephan T. Lavavej
d08ba82b09 [libcxx] [test] Update msvc_stdlib_force_include.hpp.
MSVC's STL is replacing _HAS_FUNCTION_ASSIGN with _HAS_FUNCTION_ALLOCATOR_SUPPORT,
and is adding _HAS_UNEXPECTED.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@308535 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-19 22:02:33 +00:00
Marshall Clow
7afe61ad1d Add case for c++2a to libc++ and test macros
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@308159 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-17 03:02:27 +00:00
Eric Fiselier
186b81a517 Attempt to avoid static init ordering issues with globalMemCounter
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305955 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-21 21:42:50 +00:00
Duncan P. N. Exon Smith
10a803db2c any: Add availability for experimental::bad_any_cast
As a follow up to r302172, add missing availability for bad_any_cast.

rdar://problem/32161524

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305647 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-18 14:52:26 +00:00
Marshall Clow
ff5f9b28ba Add some const_casts in places where we were implicitly casting away constness. No functional change, but now they're explicit
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305410 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 20:00:36 +00:00
Marshall Clow
246eb897c9 Fix bug 33389 - __is_transparent check requires too much
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305292 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 14:34:58 +00:00
Stephan T. Lavavej
76836caa7d [libcxx] [test] Update locale names for Windows.
locale.codecvt.byname/ctor_char.pass.cpp:
This test used to use "en_US" as a plain string instead of using platform_support.
Need to fix this because MS STL expects "en-US" instead.

platform_support.h:
These are the legacy Windows locale names. Should use IETF tags instead.
I've also added en_US, since a test was using that as a locale string as well.

msvc_stdlib_force_include.hpp:
Remove _MSVC_STL_VER. The libraries will directly define _MSVC_STL_VERSION in the future.

Fixes D29351.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@305000 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 18:22:03 +00:00
Casey Carter
3da9072b08 [test] Test changes to accommodate LWG 2904 "Make variant move-assignment more exception safe"
Also: Move constexpr / triviality extension tests into the std tree and make them conditional on _LIBCPP_VERSION / _MSVC_STL_VERSION.

https://reviews.llvm.org/D32671

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304847 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:06:04 +00:00
Stephan T. Lavavej
018fbafdf3 [libcxx] [test] Add _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS to msvc_stdlib_force_include.hpp.
This macro will instruct MSVC's STL to not warn about features that are deprecated in C++17,
as libcxx tests those features and uses them elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304765 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 02:46:12 +00:00
Casey Carter
91d004da6c [test] Remove workaround for C1XX empty parameter pack bug
Was VSO#109062. This bug was filed *4 years ago*. I submitted a workaround to enable the scoped_allocator_adaptor tests to pass. Bug fixed a week and a half later. This was either a waste of my time, or I've discovered that libc++ has magical bugfix-inducing powers. My money's on the latter.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304730 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-05 19:59:17 +00:00
Eric Fiselier
256425754d Guard against more macros in tchar.h
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304352 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 21:39:54 +00:00
Eric Fiselier
ac633a2a52 Remove uses of _UI because Windows is evil and tchar.h #define's it
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304348 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 21:20:18 +00:00
Casey Carter
bed65743b4 [test] s/uexpectedly/unexpectedly/
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304236 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 20:12:55 +00:00
Eric Fiselier
10d9a93ddd [coroutines] Add end-to-end tests within libc++
This patch adds end-to-end/breathing tests for coroutines
into libc++. The tests aren't specifically to test libc++ requirements
but instead are intented to ensure coroutines are working fine in general.

Although libc++ isn't exactly the most correct place for these tests
to live, there is one major advantage. The libc++ test suite is also
used by MSVC and by adding the tests here it ensures they will be
run against all currently available coroutine implementations.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@304101 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-28 19:38:21 +00:00
Casey Carter
a42191c839 [test] Remove workaround for C1XX conversion-to-nullptr bug
VSO#391542 "Types can't be convertible to nullptr_t"

Also put internal bug numbers on the workarounds in test_workarounds.h for correlation.

Differential Revision: https://reviews.llvm.org/D33290

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303889 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 17:42:21 +00:00
Casey Carter
8b55cce1c8 [test] Workaround C1XX bug in uses_allocator_types.hpp
VSO#109062 "Explicit template argument specification with empty template parameter pack expansion does not imply further empty pack expansion"

Differential Revision: https://reviews.llvm.org/D33214

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 17:42:17 +00:00
Eric Fiselier
737c3bf25e Add <experimental/coroutine>
This patch adds the library portions of the coroutines PDTS,
which should now be supported by Clang.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303836 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 04:36:24 +00:00
Marshall Clow
9e6b540dad Make next/prev/advance/distance operations on iterators be constexpr. I missed this when I implemented the rest of P0031R0
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@303281 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-17 18:51:36 +00:00
Billy Robert O'Neal III
5f3d5935a3 Fix bad #endif in msvc_stdlib_force_include.hpp.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302728 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-10 20:58:30 +00:00
Casey Carter
f0346a5663 [test] support machinery changes for EDG & C1XX /Za
This change works around a couple of bugs:

1. EDG doesn't like explicit constexpr in a derived class. This program:

  struct Base {};
  struct Derived : Base {
      constexpr Derived() = default;
  };

  triggers "error: defaulted default constructor cannot be constexpr."

2. C1XX with /Za has no idea which constructor needs to be valid for copy elision.

The change also conditionally disables parts of the msvc_stdlib_force_include.hpp header that conflict with external configuration when _LIBCXX_IN_DEVCRT is defined.

Differential Revision: https://reviews.llvm.org/D32778

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302707 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-10 19:10:49 +00:00
Eric Fiselier
01c2bb3677 Fix misspelling of environment throughout libc++
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302600 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-09 23:47:20 +00:00
Stephan T. Lavavej
5dbf234992 [libcxx] [test] Suppress MSVC's /analyze warning C6294 in a more fine-grained manner.
Fixes D32926.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302325 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 23:51:39 +00:00
Eric Fiselier
29514913dd Fix test failure with GCC 4.9
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302182 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-04 19:13:28 +00:00
Casey Carter
49abbf545e [test] Name the local variable in the C1XX implementation of DoNotOptmize
Differential Revision: https://reviews.llvm.org/D32510

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302162 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-04 15:54:09 +00:00
Casey Carter
d252306885 [test] variant: enable constexpr construction tests on MSVC STL
* Add a new macro _MSVC_STL_VER to detect when the MSVC STL is being tested
* Workaround C1XX __is_trivially_copyable bug

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302158 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-04 15:32:54 +00:00
Stephan T. Lavavej
bd0685fed0 [libcxx] [test] In msvc_stdlib_force_include.hpp, use _HAS_CXX17 to set TEST_STD_VER.
_HAS_CXX17 indicates whether MSVC's STL is in C++17 mode.

In MSVC there's a distinction between CRT headers like stdlib.h and STL headers
like cstdlib. Only the STL headers drag in yvals.h, our internal STL-wide header
that defines internal macros like _HAS_CXX17.

_HAS_CXX17 is an MSVC STL library macro, unconditionally defined. We centralize
everything on this, because we have to ask different questions to determine
whether C1XX, EDG, or Clang is in 14 or 17 mode, and we additionally permit
users to override the detection in one way (it's okay to ask for 17 from the
compiler, but only 14 from the libs, at least for the moment; only noexcept
in the type system will give us a headache).

As this header is for testing MSVC's STL, we can assume _HAS_CXX17 is defined.

Fixes D32726.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302104 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-04 01:35:11 +00:00