Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Differential D110494 Diff 375090 libcxx/test/std/language.support/support.limits/support.limits.general/format.version.pass.cpp
Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/std/language.support/support.limits/support.limits.general/format.version.pass.cpp
Show All 12 Lines | |||||
// UNSUPPORTED: libcpp-has-no-incomplete-format | // UNSUPPORTED: libcpp-has-no-incomplete-format | ||||
// <format> | // <format> | ||||
// Test the feature test macros defined by <format> | // Test the feature test macros defined by <format> | ||||
/* Constant Value | /* Constant Value | ||||
__cpp_lib_format 201907L [C++20] | __cpp_lib_format 202106L [C++20] | ||||
*/ | */ | ||||
#include <format> | #include <format> | ||||
#include "test_macros.h" | #include "test_macros.h" | ||||
#if TEST_STD_VER < 14 | #if TEST_STD_VER < 14 | ||||
# ifdef __cpp_lib_format | # ifdef __cpp_lib_format | ||||
Show All 13 Lines | |||||
# endif | # endif | ||||
#elif TEST_STD_VER == 20 | #elif TEST_STD_VER == 20 | ||||
# if !defined(_LIBCPP_VERSION) | # if !defined(_LIBCPP_VERSION) | ||||
# ifndef __cpp_lib_format | # ifndef __cpp_lib_format | ||||
# error "__cpp_lib_format should be defined in c++20" | # error "__cpp_lib_format should be defined in c++20" | ||||
# endif | # endif | ||||
# if __cpp_lib_format != 201907L | # if __cpp_lib_format != 202106L | ||||
# error "__cpp_lib_format should have the value 201907L in c++20" | # error "__cpp_lib_format should have the value 202106L in c++20" | ||||
# endif | # endif | ||||
# else // _LIBCPP_VERSION | # else // _LIBCPP_VERSION | ||||
# ifdef __cpp_lib_format | # ifdef __cpp_lib_format | ||||
# error "__cpp_lib_format should not be defined because it is unimplemented in libc++!" | # error "__cpp_lib_format should not be defined because it is unimplemented in libc++!" | ||||
# endif | # endif | ||||
# endif | # endif | ||||
#elif TEST_STD_VER > 20 | #elif TEST_STD_VER > 20 | ||||
# if !defined(_LIBCPP_VERSION) | # if !defined(_LIBCPP_VERSION) | ||||
# ifndef __cpp_lib_format | # ifndef __cpp_lib_format | ||||
# error "__cpp_lib_format should be defined in c++2b" | # error "__cpp_lib_format should be defined in c++2b" | ||||
# endif | # endif | ||||
# if __cpp_lib_format != 201907L | # if __cpp_lib_format != 202106L | ||||
# error "__cpp_lib_format should have the value 201907L in c++2b" | # error "__cpp_lib_format should have the value 202106L in c++2b" | ||||
# endif | # endif | ||||
# else // _LIBCPP_VERSION | # else // _LIBCPP_VERSION | ||||
# ifdef __cpp_lib_format | # ifdef __cpp_lib_format | ||||
# error "__cpp_lib_format should not be defined because it is unimplemented in libc++!" | # error "__cpp_lib_format should not be defined because it is unimplemented in libc++!" | ||||
# endif | # endif | ||||
# endif | # endif | ||||
#endif // TEST_STD_VER > 20 | #endif // TEST_STD_VER > 20 | ||||
int main(int, char**) { return 0; } | int main(int, char**) { return 0; } |