Commit Graph

4 Commits

Author SHA1 Message Date
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