Commit Graph

19 Commits

Author SHA1 Message Date
Casey Carter
6f21f89dc4 [libc++] [test] Silence C++20 deprecation warnings in the MSVC STL
... when including msvc_stdlib_force_include.hpp.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@358782 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-19 20:39:41 +00:00
Casey Carter
96442b7341 [test] Define _LIBCPP_AVAILABILITY_THROW_BAD_ANY_CAST in msvc_stdlib_force_include.hpp
...so the tests under test/std/utilities/any continue to
compile with MSVC's standard library.

While we're here, let's test >C++17 features when _HAS_CXX20.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351991 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23 22:49:44 +00:00
Chandler Carruth
7c3769df62 Update more file headers across all of the LLVM projects in the monorepo
to reflect the new license. These used slightly different spellings that
defeated my regular expressions.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@351648 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 10:56:40 +00:00
Stephan T. Lavavej
9c0cb24c23 [libcxx] [test] Update msvc_stdlib_force_include.hpp.
MSVC's STL removed _SCL_SECURE_NO_WARNINGS.

MSVC's STL implemented feature-test macros.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@334675 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-14 00:12:14 +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
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
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
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
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
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
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
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
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
Stephan T. Lavavej
02af098ef7 [libcxx] [test] Fix Clang -Wdeprecated-declarations with MSVC's CRT.
libcxx's tests use various C Standard Library functions that have been
marked by MSVC's CRT as deprecated by Microsoft (not by ISO).

libcxx's usage is cromulent (just checking with decltype to see if the functions
are being dragged in by various headers as required by the Standard), so
defining _CRT_SECURE_NO_WARNINGS will silence the warnings in a targeted manner.
This needs to be defined before including any CRT headers.

Also, make this file prettier.

Fixes D29138.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294157 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 22:48:02 +00:00
Eric Fiselier
e70e03c7f6 Adjust msvc_stdlib_force_include.hpp to handle clang++
Summary: This patch adjusts the newly added `msvc_stdlib_force_include.hpp` so that it also works when used with `clang++`.

Reviewers: STL_MSFT

Reviewed By: STL_MSFT

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292539 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-19 23:48:05 +00:00
Stephan T. Lavavej
aa0c167446 [libcxx] [test] Add msvc_stdlib_force_include.hpp.
No functional change; nothing includes this, instead our test harness
injects it via the /FI compiler option.

No code review; blessed in advance by EricWF.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 22:19:14 +00:00