[libcxx] r348846 - [libcxx] Fix test on compilers that do not support char8_t yet
Louis Dionne
ldionne at apple.com
Tue Dec 11 06:15:55 PST 2018
Author: ldionne
Date: Tue Dec 11 06:15:54 2018
New Revision: 348846
URL: http://llvm.org/viewvc/llvm-project?rev=348846&view=rev
Log:
[libcxx] Fix test on compilers that do not support char8_t yet
Modified:
libcxx/trunk/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/length.pass.cpp
Modified: libcxx/trunk/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/length.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/length.pass.cpp?rev=348846&r1=348845&r2=348846&view=diff
==============================================================================
--- libcxx/trunk/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/length.pass.cpp (original)
+++ libcxx/trunk/test/std/strings/char.traits/char.traits.specializations/char.traits.specializations.char8_t/length.pass.cpp Tue Dec 11 06:15:54 2018
@@ -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>::length(u8"") == 0
@@ -27,7 +28,6 @@ constexpr bool test_constexpr()
int main()
{
-#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
assert(std::char_traits<char8_t>::length(u8"") == 0);
assert(std::char_traits<char8_t>::length(u8"a") == 1);
assert(std::char_traits<char8_t>::length(u8"aa") == 2);
@@ -35,5 +35,7 @@ int main()
assert(std::char_traits<char8_t>::length(u8"aaaa") == 4);
static_assert(test_constexpr(), "");
-#endif
}
+#else
+int main() { }
+#endif
More information about the libcxx-commits
mailing list