Fix problems with char8_t stuff on compilers that don't support char8_t yet
authorMarshall Clow <mclow.lists@gmail.com>
Tue, 11 Dec 2018 06:06:49 +0000 (06:06 +0000)
committerMarshall Clow <mclow.lists@gmail.com>
Tue, 11 Dec 2018 06:06:49 +0000 (06:06 +0000)
llvm-svn: 348829

libcxx/test/std/language.support/support.limits/support.limits.general/atomic.version.pass.cpp
libcxx/test/std/language.support/support.limits/support.limits.general/filesystem.version.pass.cpp
libcxx/test/std/language.support/support.limits/support.limits.general/istream.version.pass.cpp
libcxx/test/std/language.support/support.limits/support.limits.general/limits.version.pass.cpp
libcxx/test/std/language.support/support.limits/support.limits.general/locale.version.pass.cpp
libcxx/test/std/language.support/support.limits/support.limits.general/ostream.version.pass.cpp
libcxx/test/std/language.support/support.limits/support.limits.general/string.version.pass.cpp
libcxx/test/std/language.support/support.limits/support.limits.general/string_view.version.pass.cpp
libcxx/test/std/language.support/support.limits/support.limits.general/version.version.pass.cpp
libcxx/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/compare.pass.cpp

index a990cab..78ee09d 100644 (file)
@@ -27,7 +27,7 @@ int main()
 {
 //  ensure that the macros that are supposed to be defined in <atomic> are defined.
 
-#if TEST_STD_VER > 17
+#if TEST_STD_VER > 17 && defined(__cpp_char8_t)
 # if !defined(__cpp_lib_char8_t)  
   LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
 # else
index 160a997..4d03634 100644 (file)
@@ -24,7 +24,7 @@ int main()
 {
 //  ensure that the macros that are supposed to be defined in <filesystem> are defined.
 
-#if TEST_STD_VER > 17
+#if TEST_STD_VER > 17 && defined(__cpp_char8_t)
 # if !defined(__cpp_lib_char8_t)  
   LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
 # else
index dfa0052..7ede323 100644 (file)
@@ -23,7 +23,7 @@ int main()
 {
 //  ensure that the macros that are supposed to be defined in <istream> are defined.
 
-#if TEST_STD_VER > 17
+#if TEST_STD_VER > 17 && defined(__cpp_char8_t)
 # if !defined(__cpp_lib_char8_t)  
   LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
 # else
index 5d49971..7f18692 100644 (file)
@@ -23,7 +23,7 @@ int main()
 {
 //  ensure that the macros that are supposed to be defined in <limits> are defined.
 
-#if TEST_STD_VER > 17
+#if TEST_STD_VER > 17 && defined(__cpp_char8_t)
 # if !defined(__cpp_lib_char8_t)  
   LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
 # else
index 4c45c0a..6022733 100644 (file)
@@ -23,7 +23,7 @@ int main()
 {
 //  ensure that the macros that are supposed to be defined in <locale> are defined.
 
-#if TEST_STD_VER > 17
+#if TEST_STD_VER > 17 && defined(__cpp_char8_t)
 # if !defined(__cpp_lib_char8_t)  
   LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
 # else
index 5f2ffb2..668b39e 100644 (file)
@@ -23,7 +23,7 @@ int main()
 {
 //  ensure that the macros that are supposed to be defined in <ostream> are defined.
 
-#if TEST_STD_VER > 17
+#if TEST_STD_VER > 17 && defined(__cpp_char8_t)
 # if !defined(__cpp_lib_char8_t)  
   LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
 # else
index 02aa15c..2f408b9 100644 (file)
@@ -27,7 +27,7 @@ int main()
 {
 //  ensure that the macros that are supposed to be defined in <string> are defined.
 
-#if TEST_STD_VER > 17
+#if TEST_STD_VER > 17 && defined(__cpp_char8_t)
 # if !defined(__cpp_lib_char8_t)  
   LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
 # else
index 82f1c66..bbdeb0b 100644 (file)
@@ -24,7 +24,7 @@ int main()
 {
 //  ensure that the macros that are supposed to be defined in <string_view> are defined.
 
-#if TEST_STD_VER > 17
+#if TEST_STD_VER > 17 && defined(__cpp_char8_t)
 # if !defined(__cpp_lib_char8_t)  
   LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
 # else
index f4be2eb..e2179e0 100644 (file)
@@ -127,7 +127,7 @@ int main()
 # endif
 #endif
 
-#if TEST_STD_VER > 17
+#if TEST_STD_VER > 17 && defined(__cpp_char8_t)
 # if !defined(__cpp_lib_char8_t)  
   LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
 # else
index 0ce036a..5ab1c9f 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "test_macros.h"
 
+#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
 constexpr bool test_constexpr()
 {
     return std::char_traits<char8_t>::compare(u8"123", u8"223", 3) < 0
@@ -29,7 +30,6 @@ constexpr bool test_constexpr()
 
 int main()
 {
-#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
     assert(std::char_traits<char8_t>::compare(u8"", u8"", 0) == 0);
     assert(std::char_traits<char8_t>::compare(NULL, NULL, 0) == 0);
 
@@ -52,5 +52,7 @@ int main()
     assert(std::char_traits<char8_t>::compare(u8"124", u8"123", 3) > 0);
 
     static_assert(test_constexpr(), "" );
-#endif
 }
+#else
+int main () {}
+#endif