Differential D113408 Diff 394654 libcxx/test/std/language.support/support.limits/support.limits.general/optional.version.pass.cpp
Changeset View
Changeset View
Standalone View
Standalone View
libcxx/test/std/language.support/support.limits/support.limits.general/optional.version.pass.cpp
Show All 9 Lines | |||||
// and should not be edited manually. | // and should not be edited manually. | ||||
// | // | ||||
// clang-format off | // clang-format off | ||||
// <optional> | // <optional> | ||||
// Test the feature test macros defined by <optional> | // Test the feature test macros defined by <optional> | ||||
/* Constant Value | /* Constant Value | ||||
__cpp_lib_monadic_optional 202110L [C++2b] | |||||
__cpp_lib_optional 201606L [C++17] | __cpp_lib_optional 201606L [C++17] | ||||
*/ | */ | ||||
#include <optional> | #include <optional> | ||||
#include "test_macros.h" | #include "test_macros.h" | ||||
#if TEST_STD_VER < 14 | #if TEST_STD_VER < 14 | ||||
# ifdef __cpp_lib_monadic_optional | |||||
# error "__cpp_lib_monadic_optional should not be defined before c++2b" | |||||
# endif | |||||
# ifdef __cpp_lib_optional | # ifdef __cpp_lib_optional | ||||
# error "__cpp_lib_optional should not be defined before c++17" | # error "__cpp_lib_optional should not be defined before c++17" | ||||
# endif | # endif | ||||
#elif TEST_STD_VER == 14 | #elif TEST_STD_VER == 14 | ||||
# ifdef __cpp_lib_monadic_optional | |||||
# error "__cpp_lib_monadic_optional should not be defined before c++2b" | |||||
# endif | |||||
# ifdef __cpp_lib_optional | # ifdef __cpp_lib_optional | ||||
# error "__cpp_lib_optional should not be defined before c++17" | # error "__cpp_lib_optional should not be defined before c++17" | ||||
# endif | # endif | ||||
#elif TEST_STD_VER == 17 | #elif TEST_STD_VER == 17 | ||||
# ifdef __cpp_lib_monadic_optional | |||||
# error "__cpp_lib_monadic_optional should not be defined before c++2b" | |||||
# endif | |||||
# ifndef __cpp_lib_optional | # ifndef __cpp_lib_optional | ||||
# error "__cpp_lib_optional should be defined in c++17" | # error "__cpp_lib_optional should be defined in c++17" | ||||
# endif | # endif | ||||
# if __cpp_lib_optional != 201606L | # if __cpp_lib_optional != 201606L | ||||
# error "__cpp_lib_optional should have the value 201606L in c++17" | # error "__cpp_lib_optional should have the value 201606L in c++17" | ||||
# endif | # endif | ||||
#elif TEST_STD_VER == 20 | #elif TEST_STD_VER == 20 | ||||
# ifdef __cpp_lib_monadic_optional | |||||
# error "__cpp_lib_monadic_optional should not be defined before c++2b" | |||||
# endif | |||||
# ifndef __cpp_lib_optional | # ifndef __cpp_lib_optional | ||||
# error "__cpp_lib_optional should be defined in c++20" | # error "__cpp_lib_optional should be defined in c++20" | ||||
# endif | # endif | ||||
# if __cpp_lib_optional != 201606L | # if __cpp_lib_optional != 201606L | ||||
# error "__cpp_lib_optional should have the value 201606L in c++20" | # error "__cpp_lib_optional should have the value 201606L in c++20" | ||||
# endif | # endif | ||||
#elif TEST_STD_VER > 20 | #elif TEST_STD_VER > 20 | ||||
# ifndef __cpp_lib_monadic_optional | |||||
# error "__cpp_lib_monadic_optional should be defined in c++2b" | |||||
# endif | |||||
# if __cpp_lib_monadic_optional != 202110L | |||||
# error "__cpp_lib_monadic_optional should have the value 202110L in c++2b" | |||||
# endif | |||||
# ifndef __cpp_lib_optional | # ifndef __cpp_lib_optional | ||||
# error "__cpp_lib_optional should be defined in c++2b" | # error "__cpp_lib_optional should be defined in c++2b" | ||||
# endif | # endif | ||||
# if __cpp_lib_optional != 201606L | # if __cpp_lib_optional != 201606L | ||||
# error "__cpp_lib_optional should have the value 201606L in c++2b" | # error "__cpp_lib_optional should have the value 201606L in c++2b" | ||||
# endif | # endif | ||||
#endif // TEST_STD_VER > 20 | #endif // TEST_STD_VER > 20 | ||||
int main(int, char**) { return 0; } | int main(int, char**) { return 0; } |