[PATCH] D32726: [libcxx] [test] In msvc_stdlib_force_include.hpp, use _HAS_CXX17 to set TEST_STD_VER.
STL_MSFT added inline comments. Comment at: test/support/msvc_stdlib_force_include.hpp:76 +#include + EricWF wrote: > Is the `stdlib.h` include above not enough? It isn't enough. 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`. Comment at: test/support/msvc_stdlib_force_include.hpp:78 + +#if _HAS_CXX17 +#define TEST_STD_VER 17 EricWF wrote: > Should this be `#if defined(_HAS_CXX17) && _HAS_CXX17` since Clang doesn't > define it to the best of my knowledge? (Or maybe Clang/C2 does, IDK) I guess I didn't explain the macro. `_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. https://reviews.llvm.org/D32726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D32726: [libcxx] [test] In msvc_stdlib_force_include.hpp, use _HAS_CXX17 to set TEST_STD_VER.
EricWF added a comment. Also you're free to commit to MSVC specific files without pre-commit review :-) https://reviews.llvm.org/D32726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D32726: [libcxx] [test] In msvc_stdlib_force_include.hpp, use _HAS_CXX17 to set TEST_STD_VER.
EricWF accepted this revision. EricWF added a comment. This revision is now accepted and ready to land. LGTM after addressing inline comments. Comment at: test/support/msvc_stdlib_force_include.hpp:76 +#include + Is the `stdlib.h` include above not enough? Comment at: test/support/msvc_stdlib_force_include.hpp:78 + +#if _HAS_CXX17 +#define TEST_STD_VER 17 Should this be `#if defined(_HAS_CXX17) && _HAS_CXX17` since Clang doesn't define it to the best of my knowledge? (Or maybe Clang/C2 does, IDK) https://reviews.llvm.org/D32726 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
[PATCH] D32726: [libcxx] [test] In msvc_stdlib_force_include.hpp, use _HAS_CXX17 to set TEST_STD_VER.
STL_MSFT created this revision. [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. https://reviews.llvm.org/D32726 Files: test/support/msvc_stdlib_force_include.hpp Index: test/support/msvc_stdlib_force_include.hpp === --- test/support/msvc_stdlib_force_include.hpp +++ test/support/msvc_stdlib_force_include.hpp @@ -40,8 +40,6 @@ // MSVC frontend only configurations #if !defined(__clang__) -#define TEST_STD_VER 17 - // Simulate feature-test macros. #define __has_feature(X) _MSVC_HAS_FEATURE_ ## X #define _MSVC_HAS_FEATURE_cxx_exceptions1 @@ -75,4 +73,12 @@ // Silence warnings about raw pointers and other unchecked iterators. #define _SCL_SECURE_NO_WARNINGS +#include + +#if _HAS_CXX17 +#define TEST_STD_VER 17 +#else // _HAS_CXX17 +#define TEST_STD_VER 14 +#endif // _HAS_CXX17 + #endif // SUPPORT_MSVC_STDLIB_FORCE_INCLUDE_HPP Index: test/support/msvc_stdlib_force_include.hpp === --- test/support/msvc_stdlib_force_include.hpp +++ test/support/msvc_stdlib_force_include.hpp @@ -40,8 +40,6 @@ // MSVC frontend only configurations #if !defined(__clang__) -#define TEST_STD_VER 17 - // Simulate feature-test macros. #define __has_feature(X) _MSVC_HAS_FEATURE_ ## X #define _MSVC_HAS_FEATURE_cxx_exceptions1 @@ -75,4 +73,12 @@ // Silence warnings about raw pointers and other unchecked iterators. #define _SCL_SECURE_NO_WARNINGS +#include + +#if _HAS_CXX17 +#define TEST_STD_VER 17 +#else // _HAS_CXX17 +#define TEST_STD_VER 14 +#endif // _HAS_CXX17 + #endif // SUPPORT_MSVC_STDLIB_FORCE_INCLUDE_HPP ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits