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_exceptions    1
@@ -75,4 +73,12 @@
 // Silence warnings about raw pointers and other unchecked iterators.
 #define _SCL_SECURE_NO_WARNINGS
 
+#include <ciso646>
+
+#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_exceptions    1
@@ -75,4 +73,12 @@
 // Silence warnings about raw pointers and other unchecked iterators.
 #define _SCL_SECURE_NO_WARNINGS
 
+#include <ciso646>
+
+#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

Reply via email to