forked from OSchip/llvm-project
Fix problems with char8_t stuff on compilers that don't support char8_t yet
llvm-svn: 348829
This commit is contained in:
parent
7dad0bd68b
commit
f17c5f6ba6
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue