diff --git a/libcxx/test/libcxx/feature_test_macro/ftm_metadata.sh.py b/libcxx/test/libcxx/feature_test_macro/ftm_metadata.sh.py index 52696d8bc3605..7cf35b2a21d93 100644 --- a/libcxx/test/libcxx/feature_test_macro/ftm_metadata.sh.py +++ b/libcxx/test/libcxx/feature_test_macro/ftm_metadata.sh.py @@ -27,26 +27,52 @@ def setUp(self): def test_implementation(self): expected = { "__cpp_lib_any": Metadata( - headers=["any"], test_suite_guard=None, libcxx_guard=None + headers=["any"], + available_since="c++17", + test_suite_guard=None, + libcxx_guard=None, ), "__cpp_lib_barrier": Metadata( headers=["barrier"], + available_since="c++20", test_suite_guard="!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)", libcxx_guard="_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC", ), + "__cpp_lib_clamp": Metadata( + headers=["algorithm"], + available_since="c++17", + test_suite_guard=None, + libcxx_guard=None, + ), "__cpp_lib_format": Metadata( - headers=["format"], test_suite_guard=None, libcxx_guard=None + headers=["format"], + available_since="c++20", + test_suite_guard=None, + libcxx_guard=None, ), "__cpp_lib_parallel_algorithm": Metadata( headers=["algorithm", "numeric"], + available_since="c++17", + test_suite_guard=None, + libcxx_guard=None, + ), + "__cpp_lib_to_chars": Metadata( + headers=["charconv"], + available_since="c++17", test_suite_guard=None, libcxx_guard=None, ), "__cpp_lib_variant": Metadata( - headers=["variant"], test_suite_guard=None, libcxx_guard=None + headers=["variant"], + available_since="c++17", + test_suite_guard=None, + libcxx_guard=None, ), - "__cpp_lib_missing_FTM_in_older_standard": Metadata( - headers=[], test_suite_guard=None, libcxx_guard=None + "__cpp_lib_zz_missing_FTM_in_older_standard": Metadata( + headers=[], + available_since="c++17", + test_suite_guard=None, + libcxx_guard=None, ), } self.assertEqual(self.ftm.ftm_metadata, expected) diff --git a/libcxx/test/libcxx/feature_test_macro/generate_header_test.sh.py b/libcxx/test/libcxx/feature_test_macro/generate_header_test.sh.py new file mode 100644 index 0000000000000..40d85108827aa --- /dev/null +++ b/libcxx/test/libcxx/feature_test_macro/generate_header_test.sh.py @@ -0,0 +1,636 @@ +# ===----------------------------------------------------------------------===## +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +# ===----------------------------------------------------------------------===## + +# RUN: %{python} %s %{libcxx-dir}/utils %{libcxx-dir}/test/libcxx/feature_test_macro/test_data.json %t/tests + +import os +import sys +import unittest + +UTILS = sys.argv[1] +TEST_DATA = sys.argv[2] +OUTPUT_PATH = sys.argv[3] +del sys.argv[1:4] + +sys.path.append(UTILS) +from generate_feature_test_macro_components import FeatureTestMacros + + +class Test(unittest.TestCase): + def setUp(self): + self.ftm = FeatureTestMacros(TEST_DATA) + self.maxDiff = None # This causes the diff to be printed when the test fails + + self.expected = dict( + { + "algorithm": """\ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 17 + +# ifdef __cpp_lib_clamp +# error "__cpp_lib_clamp should not be defined before c++17" +# endif + +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_clamp +# error "__cpp_lib_clamp should be defined in c++17" +# endif +# if __cpp_lib_clamp != 201603L +# error "__cpp_lib_clamp should have the value 201603L in c++17" +# endif + +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++17" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_clamp +# error "__cpp_lib_clamp should be defined in c++20" +# endif +# if __cpp_lib_clamp != 201603L +# error "__cpp_lib_clamp should have the value 201603L in c++20" +# endif + +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++20" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_clamp +# error "__cpp_lib_clamp should be defined in c++23" +# endif +# if __cpp_lib_clamp != 201603L +# error "__cpp_lib_clamp should have the value 201603L in c++23" +# endif + +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++23" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_clamp +# error "__cpp_lib_clamp should be defined in c++26" +# endif +# if __cpp_lib_clamp != 201603L +# error "__cpp_lib_clamp should have the value 201603L in c++26" +# endif + +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++26" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + +""", + "any": """\ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 17 + +# ifdef __cpp_lib_any +# error "__cpp_lib_any should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_any +# error "__cpp_lib_any should be defined in c++17" +# endif +# if __cpp_lib_any != 201606L +# error "__cpp_lib_any should have the value 201606L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_any +# error "__cpp_lib_any should be defined in c++20" +# endif +# if __cpp_lib_any != 201606L +# error "__cpp_lib_any should have the value 201606L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_any +# error "__cpp_lib_any should be defined in c++23" +# endif +# if __cpp_lib_any != 201606L +# error "__cpp_lib_any should have the value 201606L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_any +# error "__cpp_lib_any should be defined in c++26" +# endif +# if __cpp_lib_any != 201606L +# error "__cpp_lib_any should have the value 201606L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + +""", + "barrier": """\ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-threads + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 17 + +# ifdef __cpp_lib_barrier +# error "__cpp_lib_barrier should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_barrier +# error "__cpp_lib_barrier should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_barrier +# error "__cpp_lib_barrier should be defined in c++20" +# endif +# if __cpp_lib_barrier != 201907L +# error "__cpp_lib_barrier should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_barrier +# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_barrier +# error "__cpp_lib_barrier should be defined in c++23" +# endif +# if __cpp_lib_barrier != 201907L +# error "__cpp_lib_barrier should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_barrier +# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_barrier +# error "__cpp_lib_barrier should be defined in c++26" +# endif +# if __cpp_lib_barrier != 299900L +# error "__cpp_lib_barrier should have the value 299900L in c++26" +# endif +# else +# ifdef __cpp_lib_barrier +# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + +""", + "charconv": """\ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 17 + +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should be defined in c++17" +# endif +# if __cpp_lib_to_chars != 201611L +# error "__cpp_lib_to_chars should have the value 201611L in c++17" +# endif +# else +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should be defined in c++20" +# endif +# if __cpp_lib_to_chars != 201611L +# error "__cpp_lib_to_chars should have the value 201611L in c++20" +# endif +# else +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should be defined in c++23" +# endif +# if __cpp_lib_to_chars != 201611L +# error "__cpp_lib_to_chars should have the value 201611L in c++23" +# endif +# else +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should be defined in c++26" +# endif +# if __cpp_lib_to_chars != 201611L +# error "__cpp_lib_to_chars should have the value 201611L in c++26" +# endif +# else +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + +""", + "format": """\ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 17 + +# ifdef __cpp_lib_format +# error "__cpp_lib_format should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_format +# error "__cpp_lib_format should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_format +# error "__cpp_lib_format should be defined in c++20" +# endif +# if __cpp_lib_format != 202110L +# error "__cpp_lib_format should have the value 202110L in c++20" +# endif +# else +# ifdef __cpp_lib_format +# error "__cpp_lib_format should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_format +# error "__cpp_lib_format should be defined in c++23" +# endif +# if __cpp_lib_format != 202207L +# error "__cpp_lib_format should have the value 202207L in c++23" +# endif +# else +# ifdef __cpp_lib_format +# error "__cpp_lib_format should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_format +# error "__cpp_lib_format should be defined in c++26" +# endif +# if __cpp_lib_format != 202311L +# error "__cpp_lib_format should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_format +# error "__cpp_lib_format should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + +""", + "numeric": """\ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 17 + +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++17" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++20" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++23" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++26" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + +""", + "variant": """\ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 17 + +# ifdef __cpp_lib_variant +# error "__cpp_lib_variant should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_variant +# error "__cpp_lib_variant should be defined in c++17" +# endif +# if __cpp_lib_variant != 202102L +# error "__cpp_lib_variant should have the value 202102L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_variant +# error "__cpp_lib_variant should be defined in c++20" +# endif +# if __cpp_lib_variant != 202106L +# error "__cpp_lib_variant should have the value 202106L in c++20" +# endif +# else +# ifdef __cpp_lib_variant +# error "__cpp_lib_variant should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_variant +# error "__cpp_lib_variant should be defined in c++23" +# endif +# if __cpp_lib_variant != 202106L +# error "__cpp_lib_variant should have the value 202106L in c++23" +# endif +# else +# ifdef __cpp_lib_variant +# error "__cpp_lib_variant should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_variant +# error "__cpp_lib_variant should be defined in c++26" +# endif +# if __cpp_lib_variant != 202306L +# error "__cpp_lib_variant should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_variant +# error "__cpp_lib_variant should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + +""", + } + ) + + def test_implementation(self): + # Generate the output + self.ftm.generate_header_test_directory(OUTPUT_PATH) + + for key, value in self.expected.items(): + # Test whether the per header generate function generates the proper output. + self.assertEqual(self.ftm.generate_header_test(key), value) + + # Test whether all header generate function generates the proper output. + with open( + os.path.join(OUTPUT_PATH, f"{key}.version.compile.pass.cpp"), + "r", + newline="\n", + ) as f: + self.assertEqual(f.read(), value) + + +if __name__ == "__main__": + unittest.main() diff --git a/libcxx/test/libcxx/feature_test_macro/implemented_ftms.sh.py b/libcxx/test/libcxx/feature_test_macro/implemented_ftms.sh.py index 4f445d55c883c..1ed7524abf488 100644 --- a/libcxx/test/libcxx/feature_test_macro/implemented_ftms.sh.py +++ b/libcxx/test/libcxx/feature_test_macro/implemented_ftms.sh.py @@ -38,6 +38,12 @@ def test_implementation(self): "c++23": "201907L", "c++26": "299900L", }, + "__cpp_lib_clamp": { + "c++17": "201603L", + "c++20": "201603L", + "c++23": "201603L", + "c++26": "201603L", + }, "__cpp_lib_format": {}, "__cpp_lib_parallel_algorithm": { "c++17": "201603L", @@ -45,13 +51,14 @@ def test_implementation(self): "c++23": "201603L", "c++26": "201603L", }, + "__cpp_lib_to_chars": {}, "__cpp_lib_variant": { "c++17": "202102L", "c++20": "202102L", "c++23": "202102L", "c++26": "202102L", }, - "__cpp_lib_missing_FTM_in_older_standard": {}, + "__cpp_lib_zz_missing_FTM_in_older_standard": {}, } self.assertEqual(self.ftm.implemented_ftms, expected) diff --git a/libcxx/test/libcxx/feature_test_macro/implemented_standard_library_headers.sh.py b/libcxx/test/libcxx/feature_test_macro/implemented_standard_library_headers.sh.py new file mode 100644 index 0000000000000..4904ba24ccc05 --- /dev/null +++ b/libcxx/test/libcxx/feature_test_macro/implemented_standard_library_headers.sh.py @@ -0,0 +1,32 @@ +# ===----------------------------------------------------------------------===## +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +# ===----------------------------------------------------------------------===## + +# RUN: %{python} %s %{libcxx-dir}/utils %{libcxx-dir}/test/libcxx/feature_test_macro/test_data.json + +import sys + +sys.path.append(sys.argv[1]) +from generate_feature_test_macro_components import FeatureTestMacros + + +def test(output, expected): + assert output == expected, f"expected\n{expected}\n\noutput\n{output}" + + +ftm = FeatureTestMacros(sys.argv[2]) +test( + sorted(ftm.implemented_standard_library_headers), + [ + "algorithm", + "any", + "barrier", + "format", + "numeric", + "variant", + ], +) diff --git a/libcxx/test/libcxx/feature_test_macro/standard_ftms.sh.py b/libcxx/test/libcxx/feature_test_macro/standard_ftms.sh.py index ac3e284261d03..5c63e3e9d0ad9 100644 --- a/libcxx/test/libcxx/feature_test_macro/standard_ftms.sh.py +++ b/libcxx/test/libcxx/feature_test_macro/standard_ftms.sh.py @@ -37,6 +37,12 @@ def test_implementation(self): "c++23": "201907L", "c++26": "299900L", }, + "__cpp_lib_clamp": { + "c++17": "201603L", + "c++20": "201603L", + "c++23": "201603L", + "c++26": "201603L", + }, "__cpp_lib_format": { "c++20": "202110L", "c++23": "202207L", @@ -48,13 +54,19 @@ def test_implementation(self): "c++23": "201603L", "c++26": "201603L", }, + "__cpp_lib_to_chars": { + "c++17": "201611L", + "c++20": "201611L", + "c++23": "201611L", + "c++26": "201611L", + }, "__cpp_lib_variant": { "c++17": "202102L", "c++20": "202106L", "c++23": "202106L", "c++26": "202306L", }, - "__cpp_lib_missing_FTM_in_older_standard": { + "__cpp_lib_zz_missing_FTM_in_older_standard": { "c++17": "2017L", "c++20": "2020L", "c++23": "2020L", diff --git a/libcxx/test/libcxx/feature_test_macro/standard_library_headers.sh.py b/libcxx/test/libcxx/feature_test_macro/standard_library_headers.sh.py new file mode 100644 index 0000000000000..9cc184bcd9447 --- /dev/null +++ b/libcxx/test/libcxx/feature_test_macro/standard_library_headers.sh.py @@ -0,0 +1,33 @@ +# ===----------------------------------------------------------------------===## +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +# ===----------------------------------------------------------------------===## + +# RUN: %{python} %s %{libcxx-dir}/utils %{libcxx-dir}/test/libcxx/feature_test_macro/test_data.json + +import sys + +sys.path.append(sys.argv[1]) +from generate_feature_test_macro_components import FeatureTestMacros + + +def test(output, expected): + assert output == expected, f"expected\n{expected}\n\noutput\n{output}" + + +ftm = FeatureTestMacros(sys.argv[2]) +test( + sorted(ftm.standard_library_headers), + [ + "algorithm", + "any", + "barrier", + "charconv", + "format", + "numeric", + "variant", + ], +) diff --git a/libcxx/test/libcxx/feature_test_macro/test_data.json b/libcxx/test/libcxx/feature_test_macro/test_data.json index fd698c08b2daa..b0122163f714f 100644 --- a/libcxx/test/libcxx/feature_test_macro/test_data.json +++ b/libcxx/test/libcxx/feature_test_macro/test_data.json @@ -38,6 +38,19 @@ "test_suite_guard": "!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)", "libcxx_guard": "_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC" }, + { + "name": "__cpp_lib_clamp", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + } + }, + "headers": ["algorithm"] + }, { "name": "__cpp_lib_format", "values": { @@ -120,6 +133,19 @@ "numeric" ] }, + { + "name": "__cpp_lib_to_chars", + "values": { + "c++17": { + "201611": [ + { + "implemented": false + } + ] + } + }, + "headers": ["charconv"] + }, { "name": "__cpp_lib_variant", "values": { @@ -155,7 +181,7 @@ ] }, { - "name": "__cpp_lib_missing_FTM_in_older_standard", + "name": "__cpp_lib_zz_missing_FTM_in_older_standard", "values": { "c++17": { "2017": [ diff --git a/libcxx/test/libcxx/feature_test_macro/version_header.sh.py b/libcxx/test/libcxx/feature_test_macro/version_header.sh.py index e3053c18a5211..7ef2079505aee 100644 --- a/libcxx/test/libcxx/feature_test_macro/version_header.sh.py +++ b/libcxx/test/libcxx/feature_test_macro/version_header.sh.py @@ -45,9 +45,11 @@ def test_implementeation(self): #if _LIBCPP_STD_VER >= 17 # define __cpp_lib_any 201606L +# define __cpp_lib_clamp 201603L # define __cpp_lib_parallel_algorithm 201603L +// define __cpp_lib_to_chars 201611L # define __cpp_lib_variant 202102L -// define __cpp_lib_missing_FTM_in_older_standard 2017L +// define __cpp_lib_zz_missing_FTM_in_older_standard 2017L #endif // _LIBCPP_STD_VER >= 17 #if _LIBCPP_STD_VER >= 20 @@ -56,7 +58,7 @@ def test_implementeation(self): # endif // define __cpp_lib_format 202110L // define __cpp_lib_variant 202106L -// define __cpp_lib_missing_FTM_in_older_standard 2020L +// define __cpp_lib_zz_missing_FTM_in_older_standard 2020L #endif // _LIBCPP_STD_VER >= 20 #if _LIBCPP_STD_VER >= 23 @@ -70,7 +72,7 @@ def test_implementeation(self): # endif // define __cpp_lib_format 202311L // define __cpp_lib_variant 202306L -// define __cpp_lib_missing_FTM_in_older_standard 2026L +// define __cpp_lib_zz_missing_FTM_in_older_standard 2026L #endif // _LIBCPP_STD_VER >= 26 #endif // _LIBCPP_VERSIONH diff --git a/libcxx/test/libcxx/feature_test_macro/version_header_implementation.sh.py b/libcxx/test/libcxx/feature_test_macro/version_header_implementation.sh.py index 2ab6a9be7339b..182aca9862a4f 100644 --- a/libcxx/test/libcxx/feature_test_macro/version_header_implementation.sh.py +++ b/libcxx/test/libcxx/feature_test_macro/version_header_implementation.sh.py @@ -35,6 +35,14 @@ def test_implementation(self): condition=None, ), }, + { + "__cpp_lib_clamp": VersionHeader( + value="201603L", + implemented=True, + need_undef=False, + condition=None, + ) + }, { "__cpp_lib_parallel_algorithm": VersionHeader( value="201603L", @@ -43,6 +51,14 @@ def test_implementation(self): condition=None, ), }, + { + "__cpp_lib_to_chars": VersionHeader( + value="201611L", + implemented=False, + need_undef=False, + condition=None, + ), + }, { "__cpp_lib_variant": VersionHeader( value="202102L", @@ -52,7 +68,7 @@ def test_implementation(self): ), }, { - "__cpp_lib_missing_FTM_in_older_standard": VersionHeader( + "__cpp_lib_zz_missing_FTM_in_older_standard": VersionHeader( value="2017L", implemented=False, need_undef=False, @@ -86,7 +102,7 @@ def test_implementation(self): ), }, { - "__cpp_lib_missing_FTM_in_older_standard": VersionHeader( + "__cpp_lib_zz_missing_FTM_in_older_standard": VersionHeader( value="2020L", implemented=False, need_undef=False, @@ -130,7 +146,7 @@ def test_implementation(self): ), }, { - "__cpp_lib_missing_FTM_in_older_standard": VersionHeader( + "__cpp_lib_zz_missing_FTM_in_older_standard": VersionHeader( value="2026L", implemented=False, need_undef=False, diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/algorithm.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/algorithm.version.compile.pass.cpp new file mode 100644 index 0000000000000..488bc468bce79 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/algorithm.version.compile.pass.cpp @@ -0,0 +1,462 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_clamp +# error "__cpp_lib_clamp should not be defined before c++17" +# endif + +# ifdef __cpp_lib_constexpr_algorithms +# error "__cpp_lib_constexpr_algorithms should not be defined before c++20" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_algorithm +# error "__cpp_lib_freestanding_algorithm should not be defined before c++26" +# endif + +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined before c++17" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_ranges_contains +# error "__cpp_lib_ranges_contains should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_find_last +# error "__cpp_lib_ranges_find_last should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_starts_ends_with +# error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23" +# endif + +# ifdef __cpp_lib_robust_nonmodifying_seq_ops +# error "__cpp_lib_robust_nonmodifying_seq_ops should not be defined before c++14" +# endif + +# ifdef __cpp_lib_sample +# error "__cpp_lib_sample should not be defined before c++17" +# endif + +# ifdef __cpp_lib_shift +# error "__cpp_lib_shift should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_clamp +# error "__cpp_lib_clamp should not be defined before c++17" +# endif + +# ifdef __cpp_lib_constexpr_algorithms +# error "__cpp_lib_constexpr_algorithms should not be defined before c++20" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_algorithm +# error "__cpp_lib_freestanding_algorithm should not be defined before c++26" +# endif + +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined before c++17" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_ranges_contains +# error "__cpp_lib_ranges_contains should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_find_last +# error "__cpp_lib_ranges_find_last should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_starts_ends_with +# error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23" +# endif + +# ifndef __cpp_lib_robust_nonmodifying_seq_ops +# error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++14" +# endif +# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L +# error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++14" +# endif + +# ifdef __cpp_lib_sample +# error "__cpp_lib_sample should not be defined before c++17" +# endif + +# ifdef __cpp_lib_shift +# error "__cpp_lib_shift should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_clamp +# error "__cpp_lib_clamp should be defined in c++17" +# endif +# if __cpp_lib_clamp != 201603L +# error "__cpp_lib_clamp should have the value 201603L in c++17" +# endif + +# ifdef __cpp_lib_constexpr_algorithms +# error "__cpp_lib_constexpr_algorithms should not be defined before c++20" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_algorithm +# error "__cpp_lib_freestanding_algorithm should not be defined before c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++17" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17" +# endif +# else +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_ranges_contains +# error "__cpp_lib_ranges_contains should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_find_last +# error "__cpp_lib_ranges_find_last should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_starts_ends_with +# error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23" +# endif + +# ifndef __cpp_lib_robust_nonmodifying_seq_ops +# error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++17" +# endif +# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L +# error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++17" +# endif + +# ifndef __cpp_lib_sample +# error "__cpp_lib_sample should be defined in c++17" +# endif +# if __cpp_lib_sample != 201603L +# error "__cpp_lib_sample should have the value 201603L in c++17" +# endif + +# ifdef __cpp_lib_shift +# error "__cpp_lib_shift should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_clamp +# error "__cpp_lib_clamp should be defined in c++20" +# endif +# if __cpp_lib_clamp != 201603L +# error "__cpp_lib_clamp should have the value 201603L in c++20" +# endif + +# ifndef __cpp_lib_constexpr_algorithms +# error "__cpp_lib_constexpr_algorithms should be defined in c++20" +# endif +# if __cpp_lib_constexpr_algorithms != 201806L +# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_algorithm +# error "__cpp_lib_freestanding_algorithm should not be defined before c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++20" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20" +# endif +# else +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++20" +# endif +# if __cpp_lib_ranges != 202110L +# error "__cpp_lib_ranges should have the value 202110L in c++20" +# endif + +# ifdef __cpp_lib_ranges_contains +# error "__cpp_lib_ranges_contains should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_find_last +# error "__cpp_lib_ranges_find_last should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_starts_ends_with +# error "__cpp_lib_ranges_starts_ends_with should not be defined before c++23" +# endif + +# ifndef __cpp_lib_robust_nonmodifying_seq_ops +# error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++20" +# endif +# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L +# error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++20" +# endif + +# ifndef __cpp_lib_sample +# error "__cpp_lib_sample should be defined in c++20" +# endif +# if __cpp_lib_sample != 201603L +# error "__cpp_lib_sample should have the value 201603L in c++20" +# endif + +# ifndef __cpp_lib_shift +# error "__cpp_lib_shift should be defined in c++20" +# endif +# if __cpp_lib_shift != 201806L +# error "__cpp_lib_shift should have the value 201806L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_clamp +# error "__cpp_lib_clamp should be defined in c++23" +# endif +# if __cpp_lib_clamp != 201603L +# error "__cpp_lib_clamp should have the value 201603L in c++23" +# endif + +# ifndef __cpp_lib_constexpr_algorithms +# error "__cpp_lib_constexpr_algorithms should be defined in c++23" +# endif +# if __cpp_lib_constexpr_algorithms != 201806L +# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_algorithm +# error "__cpp_lib_freestanding_algorithm should not be defined before c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++23" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23" +# endif +# else +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++23" +# endif +# if __cpp_lib_ranges != 202406L +# error "__cpp_lib_ranges should have the value 202406L in c++23" +# endif + +# ifndef __cpp_lib_ranges_contains +# error "__cpp_lib_ranges_contains should be defined in c++23" +# endif +# if __cpp_lib_ranges_contains != 202207L +# error "__cpp_lib_ranges_contains should have the value 202207L in c++23" +# endif + +# ifndef __cpp_lib_ranges_find_last +# error "__cpp_lib_ranges_find_last should be defined in c++23" +# endif +# if __cpp_lib_ranges_find_last != 202207L +# error "__cpp_lib_ranges_find_last should have the value 202207L in c++23" +# endif + +# ifndef __cpp_lib_ranges_starts_ends_with +# error "__cpp_lib_ranges_starts_ends_with should be defined in c++23" +# endif +# if __cpp_lib_ranges_starts_ends_with != 202106L +# error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++23" +# endif + +# ifndef __cpp_lib_robust_nonmodifying_seq_ops +# error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++23" +# endif +# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L +# error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++23" +# endif + +# ifndef __cpp_lib_sample +# error "__cpp_lib_sample should be defined in c++23" +# endif +# if __cpp_lib_sample != 201603L +# error "__cpp_lib_sample should have the value 201603L in c++23" +# endif + +# ifndef __cpp_lib_shift +# error "__cpp_lib_shift should be defined in c++23" +# endif +# if __cpp_lib_shift != 201806L +# error "__cpp_lib_shift should have the value 201806L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_clamp +# error "__cpp_lib_clamp should be defined in c++26" +# endif +# if __cpp_lib_clamp != 201603L +# error "__cpp_lib_clamp should have the value 201603L in c++26" +# endif + +# ifndef __cpp_lib_constexpr_algorithms +# error "__cpp_lib_constexpr_algorithms should be defined in c++26" +# endif +# if __cpp_lib_constexpr_algorithms != 202306L +# error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26" +# endif +# if __cpp_lib_default_template_type_for_algorithm_values != 202403L +# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_freestanding_algorithm +# error "__cpp_lib_freestanding_algorithm should be defined in c++26" +# endif +# if __cpp_lib_freestanding_algorithm != 202311L +# error "__cpp_lib_freestanding_algorithm should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_freestanding_algorithm +# error "__cpp_lib_freestanding_algorithm should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++26" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++26" +# endif +# else +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++26" +# endif +# if __cpp_lib_ranges != 202406L +# error "__cpp_lib_ranges should have the value 202406L in c++26" +# endif + +# ifndef __cpp_lib_ranges_contains +# error "__cpp_lib_ranges_contains should be defined in c++26" +# endif +# if __cpp_lib_ranges_contains != 202207L +# error "__cpp_lib_ranges_contains should have the value 202207L in c++26" +# endif + +# ifndef __cpp_lib_ranges_find_last +# error "__cpp_lib_ranges_find_last should be defined in c++26" +# endif +# if __cpp_lib_ranges_find_last != 202207L +# error "__cpp_lib_ranges_find_last should have the value 202207L in c++26" +# endif + +# ifndef __cpp_lib_ranges_starts_ends_with +# error "__cpp_lib_ranges_starts_ends_with should be defined in c++26" +# endif +# if __cpp_lib_ranges_starts_ends_with != 202106L +# error "__cpp_lib_ranges_starts_ends_with should have the value 202106L in c++26" +# endif + +# ifndef __cpp_lib_robust_nonmodifying_seq_ops +# error "__cpp_lib_robust_nonmodifying_seq_ops should be defined in c++26" +# endif +# if __cpp_lib_robust_nonmodifying_seq_ops != 201304L +# error "__cpp_lib_robust_nonmodifying_seq_ops should have the value 201304L in c++26" +# endif + +# ifndef __cpp_lib_sample +# error "__cpp_lib_sample should be defined in c++26" +# endif +# if __cpp_lib_sample != 201603L +# error "__cpp_lib_sample should have the value 201603L in c++26" +# endif + +# ifndef __cpp_lib_shift +# error "__cpp_lib_shift should be defined in c++26" +# endif +# if __cpp_lib_shift != 201806L +# error "__cpp_lib_shift should have the value 201806L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/any.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/any.version.compile.pass.cpp new file mode 100644 index 0000000000000..7f3d6394749b4 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/any.version.compile.pass.cpp @@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_any +# error "__cpp_lib_any should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_any +# error "__cpp_lib_any should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_any +# error "__cpp_lib_any should be defined in c++17" +# endif +# if __cpp_lib_any != 201606L +# error "__cpp_lib_any should have the value 201606L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_any +# error "__cpp_lib_any should be defined in c++20" +# endif +# if __cpp_lib_any != 201606L +# error "__cpp_lib_any should have the value 201606L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_any +# error "__cpp_lib_any should be defined in c++23" +# endif +# if __cpp_lib_any != 201606L +# error "__cpp_lib_any should have the value 201606L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_any +# error "__cpp_lib_any should be defined in c++26" +# endif +# if __cpp_lib_any != 201606L +# error "__cpp_lib_any should have the value 201606L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/array.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/array.version.compile.pass.cpp new file mode 100644 index 0000000000000..9e50976e5cc2c --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/array.version.compile.pass.cpp @@ -0,0 +1,174 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_array_constexpr +# error "__cpp_lib_array_constexpr should not be defined before c++17" +# endif + +# ifdef __cpp_lib_freestanding_array +# error "__cpp_lib_freestanding_array should not be defined before c++26" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +# ifdef __cpp_lib_to_array +# error "__cpp_lib_to_array should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_array_constexpr +# error "__cpp_lib_array_constexpr should not be defined before c++17" +# endif + +# ifdef __cpp_lib_freestanding_array +# error "__cpp_lib_freestanding_array should not be defined before c++26" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +# ifdef __cpp_lib_to_array +# error "__cpp_lib_to_array should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_array_constexpr +# error "__cpp_lib_array_constexpr should be defined in c++17" +# endif +# if __cpp_lib_array_constexpr != 201603L +# error "__cpp_lib_array_constexpr should have the value 201603L in c++17" +# endif + +# ifdef __cpp_lib_freestanding_array +# error "__cpp_lib_freestanding_array should not be defined before c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++17" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_to_array +# error "__cpp_lib_to_array should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_array_constexpr +# error "__cpp_lib_array_constexpr should be defined in c++20" +# endif +# if __cpp_lib_array_constexpr != 201811L +# error "__cpp_lib_array_constexpr should have the value 201811L in c++20" +# endif + +# ifdef __cpp_lib_freestanding_array +# error "__cpp_lib_freestanding_array should not be defined before c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++20" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" +# endif + +# ifndef __cpp_lib_to_array +# error "__cpp_lib_to_array should be defined in c++20" +# endif +# if __cpp_lib_to_array != 201907L +# error "__cpp_lib_to_array should have the value 201907L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_array_constexpr +# error "__cpp_lib_array_constexpr should be defined in c++23" +# endif +# if __cpp_lib_array_constexpr != 201811L +# error "__cpp_lib_array_constexpr should have the value 201811L in c++23" +# endif + +# ifdef __cpp_lib_freestanding_array +# error "__cpp_lib_freestanding_array should not be defined before c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++23" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" +# endif + +# ifndef __cpp_lib_to_array +# error "__cpp_lib_to_array should be defined in c++23" +# endif +# if __cpp_lib_to_array != 201907L +# error "__cpp_lib_to_array should have the value 201907L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_array_constexpr +# error "__cpp_lib_array_constexpr should be defined in c++26" +# endif +# if __cpp_lib_array_constexpr != 201811L +# error "__cpp_lib_array_constexpr should have the value 201811L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_freestanding_array +# error "__cpp_lib_freestanding_array should be defined in c++26" +# endif +# if __cpp_lib_freestanding_array != 202311L +# error "__cpp_lib_freestanding_array should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_freestanding_array +# error "__cpp_lib_freestanding_array should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++26" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" +# endif + +# ifndef __cpp_lib_to_array +# error "__cpp_lib_to_array should be defined in c++26" +# endif +# if __cpp_lib_to_array != 201907L +# error "__cpp_lib_to_array should have the value 201907L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/atomic.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/atomic.version.compile.pass.cpp new file mode 100644 index 0000000000000..e6145bbed5af9 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/atomic.version.compile.pass.cpp @@ -0,0 +1,423 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_atomic_flag_test +# error "__cpp_lib_atomic_flag_test should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_float +# error "__cpp_lib_atomic_float should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_is_always_lock_free +# error "__cpp_lib_atomic_is_always_lock_free should not be defined before c++17" +# endif + +# ifdef __cpp_lib_atomic_lock_free_type_aliases +# error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_min_max +# error "__cpp_lib_atomic_min_max should not be defined before c++26" +# endif + +# ifdef __cpp_lib_atomic_ref +# error "__cpp_lib_atomic_ref should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_shared_ptr +# error "__cpp_lib_atomic_shared_ptr should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_value_initialization +# error "__cpp_lib_atomic_value_initialization should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_wait +# error "__cpp_lib_atomic_wait should not be defined before c++20" +# endif + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_atomic_flag_test +# error "__cpp_lib_atomic_flag_test should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_float +# error "__cpp_lib_atomic_float should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_is_always_lock_free +# error "__cpp_lib_atomic_is_always_lock_free should not be defined before c++17" +# endif + +# ifdef __cpp_lib_atomic_lock_free_type_aliases +# error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_min_max +# error "__cpp_lib_atomic_min_max should not be defined before c++26" +# endif + +# ifdef __cpp_lib_atomic_ref +# error "__cpp_lib_atomic_ref should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_shared_ptr +# error "__cpp_lib_atomic_shared_ptr should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_value_initialization +# error "__cpp_lib_atomic_value_initialization should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_wait +# error "__cpp_lib_atomic_wait should not be defined before c++20" +# endif + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_atomic_flag_test +# error "__cpp_lib_atomic_flag_test should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_float +# error "__cpp_lib_atomic_float should not be defined before c++20" +# endif + +# ifndef __cpp_lib_atomic_is_always_lock_free +# error "__cpp_lib_atomic_is_always_lock_free should be defined in c++17" +# endif +# if __cpp_lib_atomic_is_always_lock_free != 201603L +# error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++17" +# endif + +# ifdef __cpp_lib_atomic_lock_free_type_aliases +# error "__cpp_lib_atomic_lock_free_type_aliases should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_min_max +# error "__cpp_lib_atomic_min_max should not be defined before c++26" +# endif + +# ifdef __cpp_lib_atomic_ref +# error "__cpp_lib_atomic_ref should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_shared_ptr +# error "__cpp_lib_atomic_shared_ptr should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_value_initialization +# error "__cpp_lib_atomic_value_initialization should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_wait +# error "__cpp_lib_atomic_wait should not be defined before c++20" +# endif + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_atomic_flag_test +# error "__cpp_lib_atomic_flag_test should be defined in c++20" +# endif +# if __cpp_lib_atomic_flag_test != 201907L +# error "__cpp_lib_atomic_flag_test should have the value 201907L in c++20" +# endif + +# ifndef __cpp_lib_atomic_float +# error "__cpp_lib_atomic_float should be defined in c++20" +# endif +# if __cpp_lib_atomic_float != 201711L +# error "__cpp_lib_atomic_float should have the value 201711L in c++20" +# endif + +# ifndef __cpp_lib_atomic_is_always_lock_free +# error "__cpp_lib_atomic_is_always_lock_free should be defined in c++20" +# endif +# if __cpp_lib_atomic_is_always_lock_free != 201603L +# error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++20" +# endif + +# ifndef __cpp_lib_atomic_lock_free_type_aliases +# error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++20" +# endif +# if __cpp_lib_atomic_lock_free_type_aliases != 201907L +# error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++20" +# endif + +# ifdef __cpp_lib_atomic_min_max +# error "__cpp_lib_atomic_min_max should not be defined before c++26" +# endif + +# ifndef __cpp_lib_atomic_ref +# error "__cpp_lib_atomic_ref should be defined in c++20" +# endif +# if __cpp_lib_atomic_ref != 201806L +# error "__cpp_lib_atomic_ref should have the value 201806L in c++20" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_atomic_shared_ptr +# error "__cpp_lib_atomic_shared_ptr should be defined in c++20" +# endif +# if __cpp_lib_atomic_shared_ptr != 201711L +# error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++20" +# endif +# else +# ifdef __cpp_lib_atomic_shared_ptr +# error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_atomic_value_initialization +# error "__cpp_lib_atomic_value_initialization should be defined in c++20" +# endif +# if __cpp_lib_atomic_value_initialization != 201911L +# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++20" +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC +# ifndef __cpp_lib_atomic_wait +# error "__cpp_lib_atomic_wait should be defined in c++20" +# endif +# if __cpp_lib_atomic_wait != 201907L +# error "__cpp_lib_atomic_wait should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_atomic_wait +# error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!" +# endif +# endif + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++20" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_atomic_flag_test +# error "__cpp_lib_atomic_flag_test should be defined in c++23" +# endif +# if __cpp_lib_atomic_flag_test != 201907L +# error "__cpp_lib_atomic_flag_test should have the value 201907L in c++23" +# endif + +# ifndef __cpp_lib_atomic_float +# error "__cpp_lib_atomic_float should be defined in c++23" +# endif +# if __cpp_lib_atomic_float != 201711L +# error "__cpp_lib_atomic_float should have the value 201711L in c++23" +# endif + +# ifndef __cpp_lib_atomic_is_always_lock_free +# error "__cpp_lib_atomic_is_always_lock_free should be defined in c++23" +# endif +# if __cpp_lib_atomic_is_always_lock_free != 201603L +# error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++23" +# endif + +# ifndef __cpp_lib_atomic_lock_free_type_aliases +# error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++23" +# endif +# if __cpp_lib_atomic_lock_free_type_aliases != 201907L +# error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++23" +# endif + +# ifdef __cpp_lib_atomic_min_max +# error "__cpp_lib_atomic_min_max should not be defined before c++26" +# endif + +# ifndef __cpp_lib_atomic_ref +# error "__cpp_lib_atomic_ref should be defined in c++23" +# endif +# if __cpp_lib_atomic_ref != 201806L +# error "__cpp_lib_atomic_ref should have the value 201806L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_atomic_shared_ptr +# error "__cpp_lib_atomic_shared_ptr should be defined in c++23" +# endif +# if __cpp_lib_atomic_shared_ptr != 201711L +# error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++23" +# endif +# else +# ifdef __cpp_lib_atomic_shared_ptr +# error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_atomic_value_initialization +# error "__cpp_lib_atomic_value_initialization should be defined in c++23" +# endif +# if __cpp_lib_atomic_value_initialization != 201911L +# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC +# ifndef __cpp_lib_atomic_wait +# error "__cpp_lib_atomic_wait should be defined in c++23" +# endif +# if __cpp_lib_atomic_wait != 201907L +# error "__cpp_lib_atomic_wait should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_atomic_wait +# error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!" +# endif +# endif + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++23" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_atomic_flag_test +# error "__cpp_lib_atomic_flag_test should be defined in c++26" +# endif +# if __cpp_lib_atomic_flag_test != 201907L +# error "__cpp_lib_atomic_flag_test should have the value 201907L in c++26" +# endif + +# ifndef __cpp_lib_atomic_float +# error "__cpp_lib_atomic_float should be defined in c++26" +# endif +# if __cpp_lib_atomic_float != 201711L +# error "__cpp_lib_atomic_float should have the value 201711L in c++26" +# endif + +# ifndef __cpp_lib_atomic_is_always_lock_free +# error "__cpp_lib_atomic_is_always_lock_free should be defined in c++26" +# endif +# if __cpp_lib_atomic_is_always_lock_free != 201603L +# error "__cpp_lib_atomic_is_always_lock_free should have the value 201603L in c++26" +# endif + +# ifndef __cpp_lib_atomic_lock_free_type_aliases +# error "__cpp_lib_atomic_lock_free_type_aliases should be defined in c++26" +# endif +# if __cpp_lib_atomic_lock_free_type_aliases != 201907L +# error "__cpp_lib_atomic_lock_free_type_aliases should have the value 201907L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_atomic_min_max +# error "__cpp_lib_atomic_min_max should be defined in c++26" +# endif +# if __cpp_lib_atomic_min_max != 202403L +# error "__cpp_lib_atomic_min_max should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_atomic_min_max +# error "__cpp_lib_atomic_min_max should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_atomic_ref +# error "__cpp_lib_atomic_ref should be defined in c++26" +# endif +# if __cpp_lib_atomic_ref != 201806L +# error "__cpp_lib_atomic_ref should have the value 201806L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_atomic_shared_ptr +# error "__cpp_lib_atomic_shared_ptr should be defined in c++26" +# endif +# if __cpp_lib_atomic_shared_ptr != 201711L +# error "__cpp_lib_atomic_shared_ptr should have the value 201711L in c++26" +# endif +# else +# ifdef __cpp_lib_atomic_shared_ptr +# error "__cpp_lib_atomic_shared_ptr should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_atomic_value_initialization +# error "__cpp_lib_atomic_value_initialization should be defined in c++26" +# endif +# if __cpp_lib_atomic_value_initialization != 201911L +# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC +# ifndef __cpp_lib_atomic_wait +# error "__cpp_lib_atomic_wait should be defined in c++26" +# endif +# if __cpp_lib_atomic_wait != 201907L +# error "__cpp_lib_atomic_wait should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_atomic_wait +# error "__cpp_lib_atomic_wait should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC' is not met!" +# endif +# endif + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++26" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/barrier.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/barrier.version.compile.pass.cpp new file mode 100644 index 0000000000000..0d025923728b7 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/barrier.version.compile.pass.cpp @@ -0,0 +1,89 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-threads + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_barrier +# error "__cpp_lib_barrier should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_barrier +# error "__cpp_lib_barrier should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_barrier +# error "__cpp_lib_barrier should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_barrier +# error "__cpp_lib_barrier should be defined in c++20" +# endif +# if __cpp_lib_barrier != 201907L +# error "__cpp_lib_barrier should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_barrier +# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_barrier +# error "__cpp_lib_barrier should be defined in c++23" +# endif +# if __cpp_lib_barrier != 201907L +# error "__cpp_lib_barrier should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_barrier +# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_barrier +# error "__cpp_lib_barrier should be defined in c++26" +# endif +# if __cpp_lib_barrier != 201907L +# error "__cpp_lib_barrier should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_barrier +# error "__cpp_lib_barrier should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/bit.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/bit.version.compile.pass.cpp new file mode 100644 index 0000000000000..35033419ac440 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/bit.version.compile.pass.cpp @@ -0,0 +1,198 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_bit_cast +# error "__cpp_lib_bit_cast should not be defined before c++20" +# endif + +# ifdef __cpp_lib_bitops +# error "__cpp_lib_bitops should not be defined before c++20" +# endif + +# ifdef __cpp_lib_byteswap +# error "__cpp_lib_byteswap should not be defined before c++23" +# endif + +# ifdef __cpp_lib_endian +# error "__cpp_lib_endian should not be defined before c++20" +# endif + +# ifdef __cpp_lib_int_pow2 +# error "__cpp_lib_int_pow2 should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_bit_cast +# error "__cpp_lib_bit_cast should not be defined before c++20" +# endif + +# ifdef __cpp_lib_bitops +# error "__cpp_lib_bitops should not be defined before c++20" +# endif + +# ifdef __cpp_lib_byteswap +# error "__cpp_lib_byteswap should not be defined before c++23" +# endif + +# ifdef __cpp_lib_endian +# error "__cpp_lib_endian should not be defined before c++20" +# endif + +# ifdef __cpp_lib_int_pow2 +# error "__cpp_lib_int_pow2 should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_bit_cast +# error "__cpp_lib_bit_cast should not be defined before c++20" +# endif + +# ifdef __cpp_lib_bitops +# error "__cpp_lib_bitops should not be defined before c++20" +# endif + +# ifdef __cpp_lib_byteswap +# error "__cpp_lib_byteswap should not be defined before c++23" +# endif + +# ifdef __cpp_lib_endian +# error "__cpp_lib_endian should not be defined before c++20" +# endif + +# ifdef __cpp_lib_int_pow2 +# error "__cpp_lib_int_pow2 should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_bit_cast +# error "__cpp_lib_bit_cast should be defined in c++20" +# endif +# if __cpp_lib_bit_cast != 201806L +# error "__cpp_lib_bit_cast should have the value 201806L in c++20" +# endif + +# ifndef __cpp_lib_bitops +# error "__cpp_lib_bitops should be defined in c++20" +# endif +# if __cpp_lib_bitops != 201907L +# error "__cpp_lib_bitops should have the value 201907L in c++20" +# endif + +# ifdef __cpp_lib_byteswap +# error "__cpp_lib_byteswap should not be defined before c++23" +# endif + +# ifndef __cpp_lib_endian +# error "__cpp_lib_endian should be defined in c++20" +# endif +# if __cpp_lib_endian != 201907L +# error "__cpp_lib_endian should have the value 201907L in c++20" +# endif + +# ifndef __cpp_lib_int_pow2 +# error "__cpp_lib_int_pow2 should be defined in c++20" +# endif +# if __cpp_lib_int_pow2 != 202002L +# error "__cpp_lib_int_pow2 should have the value 202002L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_bit_cast +# error "__cpp_lib_bit_cast should be defined in c++23" +# endif +# if __cpp_lib_bit_cast != 201806L +# error "__cpp_lib_bit_cast should have the value 201806L in c++23" +# endif + +# ifndef __cpp_lib_bitops +# error "__cpp_lib_bitops should be defined in c++23" +# endif +# if __cpp_lib_bitops != 201907L +# error "__cpp_lib_bitops should have the value 201907L in c++23" +# endif + +# ifndef __cpp_lib_byteswap +# error "__cpp_lib_byteswap should be defined in c++23" +# endif +# if __cpp_lib_byteswap != 202110L +# error "__cpp_lib_byteswap should have the value 202110L in c++23" +# endif + +# ifndef __cpp_lib_endian +# error "__cpp_lib_endian should be defined in c++23" +# endif +# if __cpp_lib_endian != 201907L +# error "__cpp_lib_endian should have the value 201907L in c++23" +# endif + +# ifndef __cpp_lib_int_pow2 +# error "__cpp_lib_int_pow2 should be defined in c++23" +# endif +# if __cpp_lib_int_pow2 != 202002L +# error "__cpp_lib_int_pow2 should have the value 202002L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_bit_cast +# error "__cpp_lib_bit_cast should be defined in c++26" +# endif +# if __cpp_lib_bit_cast != 201806L +# error "__cpp_lib_bit_cast should have the value 201806L in c++26" +# endif + +# ifndef __cpp_lib_bitops +# error "__cpp_lib_bitops should be defined in c++26" +# endif +# if __cpp_lib_bitops != 201907L +# error "__cpp_lib_bitops should have the value 201907L in c++26" +# endif + +# ifndef __cpp_lib_byteswap +# error "__cpp_lib_byteswap should be defined in c++26" +# endif +# if __cpp_lib_byteswap != 202110L +# error "__cpp_lib_byteswap should have the value 202110L in c++26" +# endif + +# ifndef __cpp_lib_endian +# error "__cpp_lib_endian should be defined in c++26" +# endif +# if __cpp_lib_endian != 201907L +# error "__cpp_lib_endian should have the value 201907L in c++26" +# endif + +# ifndef __cpp_lib_int_pow2 +# error "__cpp_lib_int_pow2 should be defined in c++26" +# endif +# if __cpp_lib_int_pow2 != 202002L +# error "__cpp_lib_int_pow2 should have the value 202002L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/bitset.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/bitset.version.compile.pass.cpp new file mode 100644 index 0000000000000..ea61d99736208 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/bitset.version.compile.pass.cpp @@ -0,0 +1,93 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_bitset +# error "__cpp_lib_bitset should not be defined before c++26" +# endif + +# ifdef __cpp_lib_constexpr_bitset +# error "__cpp_lib_constexpr_bitset should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_bitset +# error "__cpp_lib_bitset should not be defined before c++26" +# endif + +# ifdef __cpp_lib_constexpr_bitset +# error "__cpp_lib_constexpr_bitset should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_bitset +# error "__cpp_lib_bitset should not be defined before c++26" +# endif + +# ifdef __cpp_lib_constexpr_bitset +# error "__cpp_lib_constexpr_bitset should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_bitset +# error "__cpp_lib_bitset should not be defined before c++26" +# endif + +# ifdef __cpp_lib_constexpr_bitset +# error "__cpp_lib_constexpr_bitset should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_bitset +# error "__cpp_lib_bitset should not be defined before c++26" +# endif + +# ifndef __cpp_lib_constexpr_bitset +# error "__cpp_lib_constexpr_bitset should be defined in c++23" +# endif +# if __cpp_lib_constexpr_bitset != 202207L +# error "__cpp_lib_constexpr_bitset should have the value 202207L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_bitset +# error "__cpp_lib_bitset should be defined in c++26" +# endif +# if __cpp_lib_bitset != 202306L +# error "__cpp_lib_bitset should have the value 202306L in c++26" +# endif + +# ifndef __cpp_lib_constexpr_bitset +# error "__cpp_lib_constexpr_bitset should be defined in c++26" +# endif +# if __cpp_lib_constexpr_bitset != 202207L +# error "__cpp_lib_constexpr_bitset should have the value 202207L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/charconv.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/charconv.version.compile.pass.cpp new file mode 100644 index 0000000000000..52b02562dc5ab --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/charconv.version.compile.pass.cpp @@ -0,0 +1,126 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_constexpr_charconv +# error "__cpp_lib_constexpr_charconv should not be defined before c++23" +# endif + +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_constexpr_charconv +# error "__cpp_lib_constexpr_charconv should not be defined before c++23" +# endif + +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_constexpr_charconv +# error "__cpp_lib_constexpr_charconv should not be defined before c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should be defined in c++17" +# endif +# if __cpp_lib_to_chars != 201611L +# error "__cpp_lib_to_chars should have the value 201611L in c++17" +# endif +# else +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_constexpr_charconv +# error "__cpp_lib_constexpr_charconv should not be defined before c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should be defined in c++20" +# endif +# if __cpp_lib_to_chars != 201611L +# error "__cpp_lib_to_chars should have the value 201611L in c++20" +# endif +# else +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_constexpr_charconv +# error "__cpp_lib_constexpr_charconv should be defined in c++23" +# endif +# if __cpp_lib_constexpr_charconv != 202207L +# error "__cpp_lib_constexpr_charconv should have the value 202207L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should be defined in c++23" +# endif +# if __cpp_lib_to_chars != 201611L +# error "__cpp_lib_to_chars should have the value 201611L in c++23" +# endif +# else +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_constexpr_charconv +# error "__cpp_lib_constexpr_charconv should be defined in c++26" +# endif +# if __cpp_lib_constexpr_charconv != 202207L +# error "__cpp_lib_constexpr_charconv should have the value 202207L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should be defined in c++26" +# endif +# if __cpp_lib_to_chars != 202306L +# error "__cpp_lib_to_chars should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_to_chars +# error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/chrono.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/chrono.version.compile.pass.cpp new file mode 100644 index 0000000000000..1453938b01da0 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/chrono.version.compile.pass.cpp @@ -0,0 +1,111 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_chrono +# error "__cpp_lib_chrono should not be defined before c++17" +# endif + +# ifdef __cpp_lib_chrono_udls +# error "__cpp_lib_chrono_udls should not be defined before c++14" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_chrono +# error "__cpp_lib_chrono should not be defined before c++17" +# endif + +# ifndef __cpp_lib_chrono_udls +# error "__cpp_lib_chrono_udls should be defined in c++14" +# endif +# if __cpp_lib_chrono_udls != 201304L +# error "__cpp_lib_chrono_udls should have the value 201304L in c++14" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_chrono +# error "__cpp_lib_chrono should be defined in c++17" +# endif +# if __cpp_lib_chrono != 201611L +# error "__cpp_lib_chrono should have the value 201611L in c++17" +# endif + +# ifndef __cpp_lib_chrono_udls +# error "__cpp_lib_chrono_udls should be defined in c++17" +# endif +# if __cpp_lib_chrono_udls != 201304L +# error "__cpp_lib_chrono_udls should have the value 201304L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_chrono +# error "__cpp_lib_chrono should be defined in c++20" +# endif +# if __cpp_lib_chrono != 201611L +# error "__cpp_lib_chrono should have the value 201611L in c++20" +# endif + +# ifndef __cpp_lib_chrono_udls +# error "__cpp_lib_chrono_udls should be defined in c++20" +# endif +# if __cpp_lib_chrono_udls != 201304L +# error "__cpp_lib_chrono_udls should have the value 201304L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_chrono +# error "__cpp_lib_chrono should be defined in c++23" +# endif +# if __cpp_lib_chrono != 201611L +# error "__cpp_lib_chrono should have the value 201611L in c++23" +# endif + +# ifndef __cpp_lib_chrono_udls +# error "__cpp_lib_chrono_udls should be defined in c++23" +# endif +# if __cpp_lib_chrono_udls != 201304L +# error "__cpp_lib_chrono_udls should have the value 201304L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_chrono +# error "__cpp_lib_chrono should be defined in c++26" +# endif +# if __cpp_lib_chrono != 201611L +# error "__cpp_lib_chrono should have the value 201611L in c++26" +# endif + +# ifndef __cpp_lib_chrono_udls +# error "__cpp_lib_chrono_udls should be defined in c++26" +# endif +# if __cpp_lib_chrono_udls != 201304L +# error "__cpp_lib_chrono_udls should have the value 201304L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/cmath.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/cmath.version.compile.pass.cpp new file mode 100644 index 0000000000000..507c7ab6084f8 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/cmath.version.compile.pass.cpp @@ -0,0 +1,207 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should not be defined before c++23" +# endif + +# ifdef __cpp_lib_hypot +# error "__cpp_lib_hypot should not be defined before c++17" +# endif + +# ifdef __cpp_lib_interpolate +# error "__cpp_lib_interpolate should not be defined before c++20" +# endif + +# ifdef __cpp_lib_math_special_functions +# error "__cpp_lib_math_special_functions should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should not be defined before c++23" +# endif + +# ifdef __cpp_lib_hypot +# error "__cpp_lib_hypot should not be defined before c++17" +# endif + +# ifdef __cpp_lib_interpolate +# error "__cpp_lib_interpolate should not be defined before c++20" +# endif + +# ifdef __cpp_lib_math_special_functions +# error "__cpp_lib_math_special_functions should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should not be defined before c++23" +# endif + +# ifndef __cpp_lib_hypot +# error "__cpp_lib_hypot should be defined in c++17" +# endif +# if __cpp_lib_hypot != 201603L +# error "__cpp_lib_hypot should have the value 201603L in c++17" +# endif + +# ifdef __cpp_lib_interpolate +# error "__cpp_lib_interpolate should not be defined before c++20" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_math_special_functions +# error "__cpp_lib_math_special_functions should be defined in c++17" +# endif +# if __cpp_lib_math_special_functions != 201603L +# error "__cpp_lib_math_special_functions should have the value 201603L in c++17" +# endif +# else +# ifdef __cpp_lib_math_special_functions +# error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should not be defined before c++23" +# endif + +# ifndef __cpp_lib_hypot +# error "__cpp_lib_hypot should be defined in c++20" +# endif +# if __cpp_lib_hypot != 201603L +# error "__cpp_lib_hypot should have the value 201603L in c++20" +# endif + +# ifndef __cpp_lib_interpolate +# error "__cpp_lib_interpolate should be defined in c++20" +# endif +# if __cpp_lib_interpolate != 201902L +# error "__cpp_lib_interpolate should have the value 201902L in c++20" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_math_special_functions +# error "__cpp_lib_math_special_functions should be defined in c++20" +# endif +# if __cpp_lib_math_special_functions != 201603L +# error "__cpp_lib_math_special_functions should have the value 201603L in c++20" +# endif +# else +# ifdef __cpp_lib_math_special_functions +# error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should be defined in c++23" +# endif +# if __cpp_lib_constexpr_cmath != 202202L +# error "__cpp_lib_constexpr_cmath should have the value 202202L in c++23" +# endif +# else +# ifdef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_hypot +# error "__cpp_lib_hypot should be defined in c++23" +# endif +# if __cpp_lib_hypot != 201603L +# error "__cpp_lib_hypot should have the value 201603L in c++23" +# endif + +# ifndef __cpp_lib_interpolate +# error "__cpp_lib_interpolate should be defined in c++23" +# endif +# if __cpp_lib_interpolate != 201902L +# error "__cpp_lib_interpolate should have the value 201902L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_math_special_functions +# error "__cpp_lib_math_special_functions should be defined in c++23" +# endif +# if __cpp_lib_math_special_functions != 201603L +# error "__cpp_lib_math_special_functions should have the value 201603L in c++23" +# endif +# else +# ifdef __cpp_lib_math_special_functions +# error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should be defined in c++26" +# endif +# if __cpp_lib_constexpr_cmath != 202202L +# error "__cpp_lib_constexpr_cmath should have the value 202202L in c++26" +# endif +# else +# ifdef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_hypot +# error "__cpp_lib_hypot should be defined in c++26" +# endif +# if __cpp_lib_hypot != 201603L +# error "__cpp_lib_hypot should have the value 201603L in c++26" +# endif + +# ifndef __cpp_lib_interpolate +# error "__cpp_lib_interpolate should be defined in c++26" +# endif +# if __cpp_lib_interpolate != 201902L +# error "__cpp_lib_interpolate should have the value 201902L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_math_special_functions +# error "__cpp_lib_math_special_functions should be defined in c++26" +# endif +# if __cpp_lib_math_special_functions != 201603L +# error "__cpp_lib_math_special_functions should have the value 201603L in c++26" +# endif +# else +# ifdef __cpp_lib_math_special_functions +# error "__cpp_lib_math_special_functions should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/compare.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/compare.version.compile.pass.cpp new file mode 100644 index 0000000000000..56759a88a7348 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/compare.version.compile.pass.cpp @@ -0,0 +1,69 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_three_way_comparison +# error "__cpp_lib_three_way_comparison should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_three_way_comparison +# error "__cpp_lib_three_way_comparison should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_three_way_comparison +# error "__cpp_lib_three_way_comparison should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_three_way_comparison +# error "__cpp_lib_three_way_comparison should be defined in c++20" +# endif +# if __cpp_lib_three_way_comparison != 201907L +# error "__cpp_lib_three_way_comparison should have the value 201907L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_three_way_comparison +# error "__cpp_lib_three_way_comparison should be defined in c++23" +# endif +# if __cpp_lib_three_way_comparison != 201907L +# error "__cpp_lib_three_way_comparison should have the value 201907L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_three_way_comparison +# error "__cpp_lib_three_way_comparison should be defined in c++26" +# endif +# if __cpp_lib_three_way_comparison != 201907L +# error "__cpp_lib_three_way_comparison should have the value 201907L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/complex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/complex.version.compile.pass.cpp new file mode 100644 index 0000000000000..b5efa984b456a --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/complex.version.compile.pass.cpp @@ -0,0 +1,108 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_complex_udls +# error "__cpp_lib_complex_udls should not be defined before c++14" +# endif + +# ifdef __cpp_lib_constexpr_complex +# error "__cpp_lib_constexpr_complex should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifndef __cpp_lib_complex_udls +# error "__cpp_lib_complex_udls should be defined in c++14" +# endif +# if __cpp_lib_complex_udls != 201309L +# error "__cpp_lib_complex_udls should have the value 201309L in c++14" +# endif + +# ifdef __cpp_lib_constexpr_complex +# error "__cpp_lib_constexpr_complex should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_complex_udls +# error "__cpp_lib_complex_udls should be defined in c++17" +# endif +# if __cpp_lib_complex_udls != 201309L +# error "__cpp_lib_complex_udls should have the value 201309L in c++17" +# endif + +# ifdef __cpp_lib_constexpr_complex +# error "__cpp_lib_constexpr_complex should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_complex_udls +# error "__cpp_lib_complex_udls should be defined in c++20" +# endif +# if __cpp_lib_complex_udls != 201309L +# error "__cpp_lib_complex_udls should have the value 201309L in c++20" +# endif + +# ifndef __cpp_lib_constexpr_complex +# error "__cpp_lib_constexpr_complex should be defined in c++20" +# endif +# if __cpp_lib_constexpr_complex != 201711L +# error "__cpp_lib_constexpr_complex should have the value 201711L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_complex_udls +# error "__cpp_lib_complex_udls should be defined in c++23" +# endif +# if __cpp_lib_complex_udls != 201309L +# error "__cpp_lib_complex_udls should have the value 201309L in c++23" +# endif + +# ifndef __cpp_lib_constexpr_complex +# error "__cpp_lib_constexpr_complex should be defined in c++23" +# endif +# if __cpp_lib_constexpr_complex != 201711L +# error "__cpp_lib_constexpr_complex should have the value 201711L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_complex_udls +# error "__cpp_lib_complex_udls should be defined in c++26" +# endif +# if __cpp_lib_complex_udls != 201309L +# error "__cpp_lib_complex_udls should have the value 201309L in c++26" +# endif + +# ifndef __cpp_lib_constexpr_complex +# error "__cpp_lib_constexpr_complex should be defined in c++26" +# endif +# if __cpp_lib_constexpr_complex != 201711L +# error "__cpp_lib_constexpr_complex should have the value 201711L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/concepts.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/concepts.version.compile.pass.cpp new file mode 100644 index 0000000000000..d9b2c43ecbd12 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/concepts.version.compile.pass.cpp @@ -0,0 +1,69 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_concepts +# error "__cpp_lib_concepts should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_concepts +# error "__cpp_lib_concepts should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_concepts +# error "__cpp_lib_concepts should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_concepts +# error "__cpp_lib_concepts should be defined in c++20" +# endif +# if __cpp_lib_concepts != 202002L +# error "__cpp_lib_concepts should have the value 202002L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_concepts +# error "__cpp_lib_concepts should be defined in c++23" +# endif +# if __cpp_lib_concepts != 202002L +# error "__cpp_lib_concepts should have the value 202002L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_concepts +# error "__cpp_lib_concepts should be defined in c++26" +# endif +# if __cpp_lib_concepts != 202002L +# error "__cpp_lib_concepts should have the value 202002L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/coroutine.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/coroutine.version.compile.pass.cpp new file mode 100644 index 0000000000000..b472b205f89d5 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/coroutine.version.compile.pass.cpp @@ -0,0 +1,69 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_coroutine +# error "__cpp_lib_coroutine should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_coroutine +# error "__cpp_lib_coroutine should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_coroutine +# error "__cpp_lib_coroutine should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_coroutine +# error "__cpp_lib_coroutine should be defined in c++20" +# endif +# if __cpp_lib_coroutine != 201902L +# error "__cpp_lib_coroutine should have the value 201902L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_coroutine +# error "__cpp_lib_coroutine should be defined in c++23" +# endif +# if __cpp_lib_coroutine != 201902L +# error "__cpp_lib_coroutine should have the value 201902L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_coroutine +# error "__cpp_lib_coroutine should be defined in c++26" +# endif +# if __cpp_lib_coroutine != 201902L +# error "__cpp_lib_coroutine should have the value 201902L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/cstddef.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/cstddef.version.compile.pass.cpp new file mode 100644 index 0000000000000..ccc034418cde0 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/cstddef.version.compile.pass.cpp @@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_byte +# error "__cpp_lib_byte should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_byte +# error "__cpp_lib_byte should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_byte +# error "__cpp_lib_byte should be defined in c++17" +# endif +# if __cpp_lib_byte != 201603L +# error "__cpp_lib_byte should have the value 201603L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_byte +# error "__cpp_lib_byte should be defined in c++20" +# endif +# if __cpp_lib_byte != 201603L +# error "__cpp_lib_byte should have the value 201603L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_byte +# error "__cpp_lib_byte should be defined in c++23" +# endif +# if __cpp_lib_byte != 201603L +# error "__cpp_lib_byte should have the value 201603L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_byte +# error "__cpp_lib_byte should be defined in c++26" +# endif +# if __cpp_lib_byte != 201603L +# error "__cpp_lib_byte should have the value 201603L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/cstdlib.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/cstdlib.version.compile.pass.cpp new file mode 100644 index 0000000000000..c18680e00b88f --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/cstdlib.version.compile.pass.cpp @@ -0,0 +1,80 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should be defined in c++23" +# endif +# if __cpp_lib_constexpr_cmath != 202202L +# error "__cpp_lib_constexpr_cmath should have the value 202202L in c++23" +# endif +# else +# ifdef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should be defined in c++26" +# endif +# if __cpp_lib_constexpr_cmath != 202202L +# error "__cpp_lib_constexpr_cmath should have the value 202202L in c++26" +# endif +# else +# ifdef __cpp_lib_constexpr_cmath +# error "__cpp_lib_constexpr_cmath should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/cstring.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/cstring.version.compile.pass.cpp new file mode 100644 index 0000000000000..0e48d440c84fd --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/cstring.version.compile.pass.cpp @@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_freestanding_cstring +# error "__cpp_lib_freestanding_cstring should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_freestanding_cstring +# error "__cpp_lib_freestanding_cstring should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_freestanding_cstring +# error "__cpp_lib_freestanding_cstring should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_freestanding_cstring +# error "__cpp_lib_freestanding_cstring should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_freestanding_cstring +# error "__cpp_lib_freestanding_cstring should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_freestanding_cstring +# error "__cpp_lib_freestanding_cstring should be defined in c++26" +# endif +# if __cpp_lib_freestanding_cstring != 202306L +# error "__cpp_lib_freestanding_cstring should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_freestanding_cstring +# error "__cpp_lib_freestanding_cstring should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/debugging.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/debugging.version.compile.pass.cpp new file mode 100644 index 0000000000000..fd59250a0f3fb --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/debugging.version.compile.pass.cpp @@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_debugging +# error "__cpp_lib_debugging should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_debugging +# error "__cpp_lib_debugging should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_debugging +# error "__cpp_lib_debugging should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_debugging +# error "__cpp_lib_debugging should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_debugging +# error "__cpp_lib_debugging should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_debugging +# error "__cpp_lib_debugging should be defined in c++26" +# endif +# if __cpp_lib_debugging != 202311L +# error "__cpp_lib_debugging should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_debugging +# error "__cpp_lib_debugging should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/deque.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/deque.version.compile.pass.cpp new file mode 100644 index 0000000000000..eff8689be9fb8 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/deque.version.compile.pass.cpp @@ -0,0 +1,204 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++17" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++20" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++20" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++23" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++23" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++23" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++23" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++26" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26" +# endif +# if __cpp_lib_default_template_type_for_algorithm_values != 202403L +# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++26" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++26" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/exception.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/exception.version.compile.pass.cpp new file mode 100644 index 0000000000000..60d6418c7459a --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/exception.version.compile.pass.cpp @@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_uncaught_exceptions +# error "__cpp_lib_uncaught_exceptions should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_uncaught_exceptions +# error "__cpp_lib_uncaught_exceptions should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_uncaught_exceptions +# error "__cpp_lib_uncaught_exceptions should be defined in c++17" +# endif +# if __cpp_lib_uncaught_exceptions != 201411L +# error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_uncaught_exceptions +# error "__cpp_lib_uncaught_exceptions should be defined in c++20" +# endif +# if __cpp_lib_uncaught_exceptions != 201411L +# error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_uncaught_exceptions +# error "__cpp_lib_uncaught_exceptions should be defined in c++23" +# endif +# if __cpp_lib_uncaught_exceptions != 201411L +# error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_uncaught_exceptions +# error "__cpp_lib_uncaught_exceptions should be defined in c++26" +# endif +# if __cpp_lib_uncaught_exceptions != 201411L +# error "__cpp_lib_uncaught_exceptions should have the value 201411L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/execution.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/execution.version.compile.pass.cpp new file mode 100644 index 0000000000000..1259f592f851c --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/execution.version.compile.pass.cpp @@ -0,0 +1,131 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_execution +# error "__cpp_lib_execution should not be defined before c++17" +# endif + +# ifdef __cpp_lib_senders +# error "__cpp_lib_senders should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_execution +# error "__cpp_lib_execution should not be defined before c++17" +# endif + +# ifdef __cpp_lib_senders +# error "__cpp_lib_senders should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_execution +# error "__cpp_lib_execution should be defined in c++17" +# endif +# if __cpp_lib_execution != 201603L +# error "__cpp_lib_execution should have the value 201603L in c++17" +# endif +# else +# ifdef __cpp_lib_execution +# error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifdef __cpp_lib_senders +# error "__cpp_lib_senders should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_execution +# error "__cpp_lib_execution should be defined in c++20" +# endif +# if __cpp_lib_execution != 201902L +# error "__cpp_lib_execution should have the value 201902L in c++20" +# endif +# else +# ifdef __cpp_lib_execution +# error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifdef __cpp_lib_senders +# error "__cpp_lib_senders should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_execution +# error "__cpp_lib_execution should be defined in c++23" +# endif +# if __cpp_lib_execution != 201902L +# error "__cpp_lib_execution should have the value 201902L in c++23" +# endif +# else +# ifdef __cpp_lib_execution +# error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifdef __cpp_lib_senders +# error "__cpp_lib_senders should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_execution +# error "__cpp_lib_execution should be defined in c++26" +# endif +# if __cpp_lib_execution != 201902L +# error "__cpp_lib_execution should have the value 201902L in c++26" +# endif +# else +# ifdef __cpp_lib_execution +# error "__cpp_lib_execution should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_senders +# error "__cpp_lib_senders should be defined in c++26" +# endif +# if __cpp_lib_senders != 202406L +# error "__cpp_lib_senders should have the value 202406L in c++26" +# endif +# else +# ifdef __cpp_lib_senders +# error "__cpp_lib_senders should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/expected.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/expected.version.compile.pass.cpp new file mode 100644 index 0000000000000..d58f726f66e2f --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/expected.version.compile.pass.cpp @@ -0,0 +1,99 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_expected +# error "__cpp_lib_expected should not be defined before c++23" +# endif + +# ifdef __cpp_lib_freestanding_expected +# error "__cpp_lib_freestanding_expected should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_expected +# error "__cpp_lib_expected should not be defined before c++23" +# endif + +# ifdef __cpp_lib_freestanding_expected +# error "__cpp_lib_freestanding_expected should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_expected +# error "__cpp_lib_expected should not be defined before c++23" +# endif + +# ifdef __cpp_lib_freestanding_expected +# error "__cpp_lib_freestanding_expected should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_expected +# error "__cpp_lib_expected should not be defined before c++23" +# endif + +# ifdef __cpp_lib_freestanding_expected +# error "__cpp_lib_freestanding_expected should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_expected +# error "__cpp_lib_expected should be defined in c++23" +# endif +# if __cpp_lib_expected != 202211L +# error "__cpp_lib_expected should have the value 202211L in c++23" +# endif + +# ifdef __cpp_lib_freestanding_expected +# error "__cpp_lib_freestanding_expected should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_expected +# error "__cpp_lib_expected should be defined in c++26" +# endif +# if __cpp_lib_expected != 202211L +# error "__cpp_lib_expected should have the value 202211L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_freestanding_expected +# error "__cpp_lib_freestanding_expected should be defined in c++26" +# endif +# if __cpp_lib_freestanding_expected != 202311L +# error "__cpp_lib_freestanding_expected should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_freestanding_expected +# error "__cpp_lib_freestanding_expected should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/filesystem.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/filesystem.version.compile.pass.cpp new file mode 100644 index 0000000000000..98acf8bb602ca --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/filesystem.version.compile.pass.cpp @@ -0,0 +1,182 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-filesystem + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +# ifdef __cpp_lib_filesystem +# error "__cpp_lib_filesystem should not be defined before c++17" +# endif + +# ifdef __cpp_lib_format_path +# error "__cpp_lib_format_path should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +# ifdef __cpp_lib_filesystem +# error "__cpp_lib_filesystem should not be defined before c++17" +# endif + +# ifdef __cpp_lib_format_path +# error "__cpp_lib_format_path should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY) +# ifndef __cpp_lib_filesystem +# error "__cpp_lib_filesystem should be defined in c++17" +# endif +# if __cpp_lib_filesystem != 201703L +# error "__cpp_lib_filesystem should have the value 201703L in c++17" +# endif +# else +# ifdef __cpp_lib_filesystem +# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!" +# endif +# endif + +# ifdef __cpp_lib_format_path +# error "__cpp_lib_format_path should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++20" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY) +# ifndef __cpp_lib_filesystem +# error "__cpp_lib_filesystem should be defined in c++20" +# endif +# if __cpp_lib_filesystem != 201703L +# error "__cpp_lib_filesystem should have the value 201703L in c++20" +# endif +# else +# ifdef __cpp_lib_filesystem +# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!" +# endif +# endif + +# ifdef __cpp_lib_format_path +# error "__cpp_lib_format_path should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++23" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY) +# ifndef __cpp_lib_filesystem +# error "__cpp_lib_filesystem should be defined in c++23" +# endif +# if __cpp_lib_filesystem != 201703L +# error "__cpp_lib_filesystem should have the value 201703L in c++23" +# endif +# else +# ifdef __cpp_lib_filesystem +# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!" +# endif +# endif + +# ifdef __cpp_lib_format_path +# error "__cpp_lib_format_path should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++26" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY) +# ifndef __cpp_lib_filesystem +# error "__cpp_lib_filesystem should be defined in c++26" +# endif +# if __cpp_lib_filesystem != 201703L +# error "__cpp_lib_filesystem should have the value 201703L in c++26" +# endif +# else +# ifdef __cpp_lib_filesystem +# error "__cpp_lib_filesystem should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_format_path +# error "__cpp_lib_format_path should be defined in c++26" +# endif +# if __cpp_lib_format_path != 202403L +# error "__cpp_lib_format_path should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_format_path +# error "__cpp_lib_format_path should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/flat_map.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/flat_map.version.compile.pass.cpp new file mode 100644 index 0000000000000..19e2fd79a4295 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/flat_map.version.compile.pass.cpp @@ -0,0 +1,66 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_flat_map +# error "__cpp_lib_flat_map should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_flat_map +# error "__cpp_lib_flat_map should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_flat_map +# error "__cpp_lib_flat_map should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_flat_map +# error "__cpp_lib_flat_map should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_flat_map +# error "__cpp_lib_flat_map should be defined in c++23" +# endif +# if __cpp_lib_flat_map != 202207L +# error "__cpp_lib_flat_map should have the value 202207L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_flat_map +# error "__cpp_lib_flat_map should be defined in c++26" +# endif +# if __cpp_lib_flat_map != 202207L +# error "__cpp_lib_flat_map should have the value 202207L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/flat_set.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/flat_set.version.compile.pass.cpp new file mode 100644 index 0000000000000..d078f9bda23c9 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/flat_set.version.compile.pass.cpp @@ -0,0 +1,66 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_flat_set +# error "__cpp_lib_flat_set should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_flat_set +# error "__cpp_lib_flat_set should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_flat_set +# error "__cpp_lib_flat_set should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_flat_set +# error "__cpp_lib_flat_set should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_flat_set +# error "__cpp_lib_flat_set should be defined in c++23" +# endif +# if __cpp_lib_flat_set != 202207L +# error "__cpp_lib_flat_set should have the value 202207L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_flat_set +# error "__cpp_lib_flat_set should be defined in c++26" +# endif +# if __cpp_lib_flat_set != 202207L +# error "__cpp_lib_flat_set should have the value 202207L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/format.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/format.version.compile.pass.cpp new file mode 100644 index 0000000000000..3fa4334143b1a --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/format.version.compile.pass.cpp @@ -0,0 +1,150 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_format +# error "__cpp_lib_format should not be defined before c++20" +# endif + +# ifdef __cpp_lib_format_ranges +# error "__cpp_lib_format_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_format_uchar +# error "__cpp_lib_format_uchar should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_format +# error "__cpp_lib_format should not be defined before c++20" +# endif + +# ifdef __cpp_lib_format_ranges +# error "__cpp_lib_format_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_format_uchar +# error "__cpp_lib_format_uchar should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_format +# error "__cpp_lib_format should not be defined before c++20" +# endif + +# ifdef __cpp_lib_format_ranges +# error "__cpp_lib_format_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_format_uchar +# error "__cpp_lib_format_uchar should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT +# ifndef __cpp_lib_format +# error "__cpp_lib_format should be defined in c++20" +# endif +# if __cpp_lib_format != 202110L +# error "__cpp_lib_format should have the value 202110L in c++20" +# endif +# else +# ifdef __cpp_lib_format +# error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!" +# endif +# endif + +# ifdef __cpp_lib_format_ranges +# error "__cpp_lib_format_ranges should not be defined before c++23" +# endif + +# ifndef __cpp_lib_format_uchar +# error "__cpp_lib_format_uchar should be defined in c++20" +# endif +# if __cpp_lib_format_uchar != 202311L +# error "__cpp_lib_format_uchar should have the value 202311L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT +# ifndef __cpp_lib_format +# error "__cpp_lib_format should be defined in c++23" +# endif +# if __cpp_lib_format != 202110L +# error "__cpp_lib_format should have the value 202110L in c++23" +# endif +# else +# ifdef __cpp_lib_format +# error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!" +# endif +# endif + +# ifndef __cpp_lib_format_ranges +# error "__cpp_lib_format_ranges should be defined in c++23" +# endif +# if __cpp_lib_format_ranges != 202207L +# error "__cpp_lib_format_ranges should have the value 202207L in c++23" +# endif + +# ifndef __cpp_lib_format_uchar +# error "__cpp_lib_format_uchar should be defined in c++23" +# endif +# if __cpp_lib_format_uchar != 202311L +# error "__cpp_lib_format_uchar should have the value 202311L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT +# ifndef __cpp_lib_format +# error "__cpp_lib_format should be defined in c++26" +# endif +# if __cpp_lib_format != 202110L +# error "__cpp_lib_format should have the value 202110L in c++26" +# endif +# else +# ifdef __cpp_lib_format +# error "__cpp_lib_format should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!" +# endif +# endif + +# ifndef __cpp_lib_format_ranges +# error "__cpp_lib_format_ranges should be defined in c++26" +# endif +# if __cpp_lib_format_ranges != 202207L +# error "__cpp_lib_format_ranges should have the value 202207L in c++26" +# endif + +# ifndef __cpp_lib_format_uchar +# error "__cpp_lib_format_uchar should be defined in c++26" +# endif +# if __cpp_lib_format_uchar != 202311L +# error "__cpp_lib_format_uchar should have the value 202311L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/forward_list.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/forward_list.version.compile.pass.cpp new file mode 100644 index 0000000000000..31b3e900aabcd --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/forward_list.version.compile.pass.cpp @@ -0,0 +1,273 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should not be defined before c++17" +# endif + +# ifdef __cpp_lib_list_remove_return_type +# error "__cpp_lib_list_remove_return_type should not be defined before c++20" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should not be defined before c++17" +# endif + +# ifdef __cpp_lib_list_remove_return_type +# error "__cpp_lib_list_remove_return_type should not be defined before c++20" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifndef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should be defined in c++17" +# endif +# if __cpp_lib_incomplete_container_elements != 201505L +# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17" +# endif + +# ifdef __cpp_lib_list_remove_return_type +# error "__cpp_lib_list_remove_return_type should not be defined before c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++17" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++20" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++20" +# endif + +# ifndef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should be defined in c++20" +# endif +# if __cpp_lib_incomplete_container_elements != 201505L +# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20" +# endif + +# ifndef __cpp_lib_list_remove_return_type +# error "__cpp_lib_list_remove_return_type should be defined in c++20" +# endif +# if __cpp_lib_list_remove_return_type != 201806L +# error "__cpp_lib_list_remove_return_type should have the value 201806L in c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++20" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++23" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++23" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++23" +# endif + +# ifndef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should be defined in c++23" +# endif +# if __cpp_lib_incomplete_container_elements != 201505L +# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23" +# endif + +# ifndef __cpp_lib_list_remove_return_type +# error "__cpp_lib_list_remove_return_type should be defined in c++23" +# endif +# if __cpp_lib_list_remove_return_type != 201806L +# error "__cpp_lib_list_remove_return_type should have the value 201806L in c++23" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++23" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++26" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26" +# endif +# if __cpp_lib_default_template_type_for_algorithm_values != 202403L +# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++26" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++26" +# endif + +# ifndef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should be defined in c++26" +# endif +# if __cpp_lib_incomplete_container_elements != 201505L +# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26" +# endif + +# ifndef __cpp_lib_list_remove_return_type +# error "__cpp_lib_list_remove_return_type should be defined in c++26" +# endif +# if __cpp_lib_list_remove_return_type != 201806L +# error "__cpp_lib_list_remove_return_type should have the value 201806L in c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++26" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/fstream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/fstream.version.compile.pass.cpp new file mode 100644 index 0000000000000..ee32346d61080 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/fstream.version.compile.pass.cpp @@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-localization + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_fstream_native_handle +# error "__cpp_lib_fstream_native_handle should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_fstream_native_handle +# error "__cpp_lib_fstream_native_handle should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_fstream_native_handle +# error "__cpp_lib_fstream_native_handle should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_fstream_native_handle +# error "__cpp_lib_fstream_native_handle should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_fstream_native_handle +# error "__cpp_lib_fstream_native_handle should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION) +# ifndef __cpp_lib_fstream_native_handle +# error "__cpp_lib_fstream_native_handle should be defined in c++26" +# endif +# if __cpp_lib_fstream_native_handle != 202306L +# error "__cpp_lib_fstream_native_handle should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_fstream_native_handle +# error "__cpp_lib_fstream_native_handle should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/functional.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/functional.version.compile.pass.cpp new file mode 100644 index 0000000000000..8dbbbf432ddbf --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/functional.version.compile.pass.cpp @@ -0,0 +1,549 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_bind_back +# error "__cpp_lib_bind_back should not be defined before c++23" +# endif + +# ifdef __cpp_lib_bind_front +# error "__cpp_lib_bind_front should not be defined before c++20" +# endif + +# ifdef __cpp_lib_boyer_moore_searcher +# error "__cpp_lib_boyer_moore_searcher should not be defined before c++17" +# endif + +# ifdef __cpp_lib_constexpr_functional +# error "__cpp_lib_constexpr_functional should not be defined before c++20" +# endif + +# ifdef __cpp_lib_copyable_function +# error "__cpp_lib_copyable_function should not be defined before c++26" +# endif + +# ifdef __cpp_lib_function_ref +# error "__cpp_lib_function_ref should not be defined before c++26" +# endif + +# ifdef __cpp_lib_invoke +# error "__cpp_lib_invoke should not be defined before c++17" +# endif + +# ifdef __cpp_lib_invoke_r +# error "__cpp_lib_invoke_r should not be defined before c++23" +# endif + +# ifdef __cpp_lib_move_only_function +# error "__cpp_lib_move_only_function should not be defined before c++23" +# endif + +# ifdef __cpp_lib_not_fn +# error "__cpp_lib_not_fn should not be defined before c++17" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_reference_wrapper +# error "__cpp_lib_reference_wrapper should not be defined before c++26" +# endif + +# ifdef __cpp_lib_result_of_sfinae +# error "__cpp_lib_result_of_sfinae should not be defined before c++14" +# endif + +# ifdef __cpp_lib_transparent_operators +# error "__cpp_lib_transparent_operators should not be defined before c++14" +# endif + +# ifdef __cpp_lib_unwrap_ref +# error "__cpp_lib_unwrap_ref should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_bind_back +# error "__cpp_lib_bind_back should not be defined before c++23" +# endif + +# ifdef __cpp_lib_bind_front +# error "__cpp_lib_bind_front should not be defined before c++20" +# endif + +# ifdef __cpp_lib_boyer_moore_searcher +# error "__cpp_lib_boyer_moore_searcher should not be defined before c++17" +# endif + +# ifdef __cpp_lib_constexpr_functional +# error "__cpp_lib_constexpr_functional should not be defined before c++20" +# endif + +# ifdef __cpp_lib_copyable_function +# error "__cpp_lib_copyable_function should not be defined before c++26" +# endif + +# ifdef __cpp_lib_function_ref +# error "__cpp_lib_function_ref should not be defined before c++26" +# endif + +# ifdef __cpp_lib_invoke +# error "__cpp_lib_invoke should not be defined before c++17" +# endif + +# ifdef __cpp_lib_invoke_r +# error "__cpp_lib_invoke_r should not be defined before c++23" +# endif + +# ifdef __cpp_lib_move_only_function +# error "__cpp_lib_move_only_function should not be defined before c++23" +# endif + +# ifdef __cpp_lib_not_fn +# error "__cpp_lib_not_fn should not be defined before c++17" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_reference_wrapper +# error "__cpp_lib_reference_wrapper should not be defined before c++26" +# endif + +# ifndef __cpp_lib_result_of_sfinae +# error "__cpp_lib_result_of_sfinae should be defined in c++14" +# endif +# if __cpp_lib_result_of_sfinae != 201210L +# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++14" +# endif + +# ifndef __cpp_lib_transparent_operators +# error "__cpp_lib_transparent_operators should be defined in c++14" +# endif +# if __cpp_lib_transparent_operators != 201210L +# error "__cpp_lib_transparent_operators should have the value 201210L in c++14" +# endif + +# ifdef __cpp_lib_unwrap_ref +# error "__cpp_lib_unwrap_ref should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_bind_back +# error "__cpp_lib_bind_back should not be defined before c++23" +# endif + +# ifdef __cpp_lib_bind_front +# error "__cpp_lib_bind_front should not be defined before c++20" +# endif + +# ifndef __cpp_lib_boyer_moore_searcher +# error "__cpp_lib_boyer_moore_searcher should be defined in c++17" +# endif +# if __cpp_lib_boyer_moore_searcher != 201603L +# error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++17" +# endif + +# ifdef __cpp_lib_constexpr_functional +# error "__cpp_lib_constexpr_functional should not be defined before c++20" +# endif + +# ifdef __cpp_lib_copyable_function +# error "__cpp_lib_copyable_function should not be defined before c++26" +# endif + +# ifdef __cpp_lib_function_ref +# error "__cpp_lib_function_ref should not be defined before c++26" +# endif + +# ifndef __cpp_lib_invoke +# error "__cpp_lib_invoke should be defined in c++17" +# endif +# if __cpp_lib_invoke != 201411L +# error "__cpp_lib_invoke should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_invoke_r +# error "__cpp_lib_invoke_r should not be defined before c++23" +# endif + +# ifdef __cpp_lib_move_only_function +# error "__cpp_lib_move_only_function should not be defined before c++23" +# endif + +# ifndef __cpp_lib_not_fn +# error "__cpp_lib_not_fn should be defined in c++17" +# endif +# if __cpp_lib_not_fn != 201603L +# error "__cpp_lib_not_fn should have the value 201603L in c++17" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_reference_wrapper +# error "__cpp_lib_reference_wrapper should not be defined before c++26" +# endif + +# ifndef __cpp_lib_result_of_sfinae +# error "__cpp_lib_result_of_sfinae should be defined in c++17" +# endif +# if __cpp_lib_result_of_sfinae != 201210L +# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17" +# endif + +# ifndef __cpp_lib_transparent_operators +# error "__cpp_lib_transparent_operators should be defined in c++17" +# endif +# if __cpp_lib_transparent_operators != 201510L +# error "__cpp_lib_transparent_operators should have the value 201510L in c++17" +# endif + +# ifdef __cpp_lib_unwrap_ref +# error "__cpp_lib_unwrap_ref should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_bind_back +# error "__cpp_lib_bind_back should not be defined before c++23" +# endif + +# ifndef __cpp_lib_bind_front +# error "__cpp_lib_bind_front should be defined in c++20" +# endif +# if __cpp_lib_bind_front != 201907L +# error "__cpp_lib_bind_front should have the value 201907L in c++20" +# endif + +# ifndef __cpp_lib_boyer_moore_searcher +# error "__cpp_lib_boyer_moore_searcher should be defined in c++20" +# endif +# if __cpp_lib_boyer_moore_searcher != 201603L +# error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++20" +# endif + +# ifndef __cpp_lib_constexpr_functional +# error "__cpp_lib_constexpr_functional should be defined in c++20" +# endif +# if __cpp_lib_constexpr_functional != 201907L +# error "__cpp_lib_constexpr_functional should have the value 201907L in c++20" +# endif + +# ifdef __cpp_lib_copyable_function +# error "__cpp_lib_copyable_function should not be defined before c++26" +# endif + +# ifdef __cpp_lib_function_ref +# error "__cpp_lib_function_ref should not be defined before c++26" +# endif + +# ifndef __cpp_lib_invoke +# error "__cpp_lib_invoke should be defined in c++20" +# endif +# if __cpp_lib_invoke != 201411L +# error "__cpp_lib_invoke should have the value 201411L in c++20" +# endif + +# ifdef __cpp_lib_invoke_r +# error "__cpp_lib_invoke_r should not be defined before c++23" +# endif + +# ifdef __cpp_lib_move_only_function +# error "__cpp_lib_move_only_function should not be defined before c++23" +# endif + +# ifndef __cpp_lib_not_fn +# error "__cpp_lib_not_fn should be defined in c++20" +# endif +# if __cpp_lib_not_fn != 201603L +# error "__cpp_lib_not_fn should have the value 201603L in c++20" +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++20" +# endif +# if __cpp_lib_ranges != 202110L +# error "__cpp_lib_ranges should have the value 202110L in c++20" +# endif + +# ifdef __cpp_lib_reference_wrapper +# error "__cpp_lib_reference_wrapper should not be defined before c++26" +# endif + +# ifndef __cpp_lib_result_of_sfinae +# error "__cpp_lib_result_of_sfinae should be defined in c++20" +# endif +# if __cpp_lib_result_of_sfinae != 201210L +# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++20" +# endif + +# ifndef __cpp_lib_transparent_operators +# error "__cpp_lib_transparent_operators should be defined in c++20" +# endif +# if __cpp_lib_transparent_operators != 201510L +# error "__cpp_lib_transparent_operators should have the value 201510L in c++20" +# endif + +# ifndef __cpp_lib_unwrap_ref +# error "__cpp_lib_unwrap_ref should be defined in c++20" +# endif +# if __cpp_lib_unwrap_ref != 201811L +# error "__cpp_lib_unwrap_ref should have the value 201811L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_bind_back +# error "__cpp_lib_bind_back should be defined in c++23" +# endif +# if __cpp_lib_bind_back != 202202L +# error "__cpp_lib_bind_back should have the value 202202L in c++23" +# endif + +# ifndef __cpp_lib_bind_front +# error "__cpp_lib_bind_front should be defined in c++23" +# endif +# if __cpp_lib_bind_front != 201907L +# error "__cpp_lib_bind_front should have the value 201907L in c++23" +# endif + +# ifndef __cpp_lib_boyer_moore_searcher +# error "__cpp_lib_boyer_moore_searcher should be defined in c++23" +# endif +# if __cpp_lib_boyer_moore_searcher != 201603L +# error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++23" +# endif + +# ifndef __cpp_lib_constexpr_functional +# error "__cpp_lib_constexpr_functional should be defined in c++23" +# endif +# if __cpp_lib_constexpr_functional != 201907L +# error "__cpp_lib_constexpr_functional should have the value 201907L in c++23" +# endif + +# ifdef __cpp_lib_copyable_function +# error "__cpp_lib_copyable_function should not be defined before c++26" +# endif + +# ifdef __cpp_lib_function_ref +# error "__cpp_lib_function_ref should not be defined before c++26" +# endif + +# ifndef __cpp_lib_invoke +# error "__cpp_lib_invoke should be defined in c++23" +# endif +# if __cpp_lib_invoke != 201411L +# error "__cpp_lib_invoke should have the value 201411L in c++23" +# endif + +# ifndef __cpp_lib_invoke_r +# error "__cpp_lib_invoke_r should be defined in c++23" +# endif +# if __cpp_lib_invoke_r != 202106L +# error "__cpp_lib_invoke_r should have the value 202106L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_move_only_function +# error "__cpp_lib_move_only_function should be defined in c++23" +# endif +# if __cpp_lib_move_only_function != 202110L +# error "__cpp_lib_move_only_function should have the value 202110L in c++23" +# endif +# else +# ifdef __cpp_lib_move_only_function +# error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_not_fn +# error "__cpp_lib_not_fn should be defined in c++23" +# endif +# if __cpp_lib_not_fn != 201603L +# error "__cpp_lib_not_fn should have the value 201603L in c++23" +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++23" +# endif +# if __cpp_lib_ranges != 202406L +# error "__cpp_lib_ranges should have the value 202406L in c++23" +# endif + +# ifdef __cpp_lib_reference_wrapper +# error "__cpp_lib_reference_wrapper should not be defined before c++26" +# endif + +# ifndef __cpp_lib_result_of_sfinae +# error "__cpp_lib_result_of_sfinae should be defined in c++23" +# endif +# if __cpp_lib_result_of_sfinae != 201210L +# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++23" +# endif + +# ifndef __cpp_lib_transparent_operators +# error "__cpp_lib_transparent_operators should be defined in c++23" +# endif +# if __cpp_lib_transparent_operators != 201510L +# error "__cpp_lib_transparent_operators should have the value 201510L in c++23" +# endif + +# ifndef __cpp_lib_unwrap_ref +# error "__cpp_lib_unwrap_ref should be defined in c++23" +# endif +# if __cpp_lib_unwrap_ref != 201811L +# error "__cpp_lib_unwrap_ref should have the value 201811L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_bind_back +# error "__cpp_lib_bind_back should be defined in c++26" +# endif +# if __cpp_lib_bind_back != 202202L +# error "__cpp_lib_bind_back should have the value 202202L in c++26" +# endif + +# ifndef __cpp_lib_bind_front +# error "__cpp_lib_bind_front should be defined in c++26" +# endif +# if __cpp_lib_bind_front != 202306L +# error "__cpp_lib_bind_front should have the value 202306L in c++26" +# endif + +# ifndef __cpp_lib_boyer_moore_searcher +# error "__cpp_lib_boyer_moore_searcher should be defined in c++26" +# endif +# if __cpp_lib_boyer_moore_searcher != 201603L +# error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++26" +# endif + +# ifndef __cpp_lib_constexpr_functional +# error "__cpp_lib_constexpr_functional should be defined in c++26" +# endif +# if __cpp_lib_constexpr_functional != 201907L +# error "__cpp_lib_constexpr_functional should have the value 201907L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_copyable_function +# error "__cpp_lib_copyable_function should be defined in c++26" +# endif +# if __cpp_lib_copyable_function != 202306L +# error "__cpp_lib_copyable_function should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_copyable_function +# error "__cpp_lib_copyable_function should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_function_ref +# error "__cpp_lib_function_ref should be defined in c++26" +# endif +# if __cpp_lib_function_ref != 202306L +# error "__cpp_lib_function_ref should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_function_ref +# error "__cpp_lib_function_ref should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_invoke +# error "__cpp_lib_invoke should be defined in c++26" +# endif +# if __cpp_lib_invoke != 201411L +# error "__cpp_lib_invoke should have the value 201411L in c++26" +# endif + +# ifndef __cpp_lib_invoke_r +# error "__cpp_lib_invoke_r should be defined in c++26" +# endif +# if __cpp_lib_invoke_r != 202106L +# error "__cpp_lib_invoke_r should have the value 202106L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_move_only_function +# error "__cpp_lib_move_only_function should be defined in c++26" +# endif +# if __cpp_lib_move_only_function != 202110L +# error "__cpp_lib_move_only_function should have the value 202110L in c++26" +# endif +# else +# ifdef __cpp_lib_move_only_function +# error "__cpp_lib_move_only_function should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_not_fn +# error "__cpp_lib_not_fn should be defined in c++26" +# endif +# if __cpp_lib_not_fn != 202306L +# error "__cpp_lib_not_fn should have the value 202306L in c++26" +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++26" +# endif +# if __cpp_lib_ranges != 202406L +# error "__cpp_lib_ranges should have the value 202406L in c++26" +# endif + +# ifndef __cpp_lib_reference_wrapper +# error "__cpp_lib_reference_wrapper should be defined in c++26" +# endif +# if __cpp_lib_reference_wrapper != 202403L +# error "__cpp_lib_reference_wrapper should have the value 202403L in c++26" +# endif + +# ifndef __cpp_lib_result_of_sfinae +# error "__cpp_lib_result_of_sfinae should be defined in c++26" +# endif +# if __cpp_lib_result_of_sfinae != 201210L +# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++26" +# endif + +# ifndef __cpp_lib_transparent_operators +# error "__cpp_lib_transparent_operators should be defined in c++26" +# endif +# if __cpp_lib_transparent_operators != 201510L +# error "__cpp_lib_transparent_operators should have the value 201510L in c++26" +# endif + +# ifndef __cpp_lib_unwrap_ref +# error "__cpp_lib_unwrap_ref should be defined in c++26" +# endif +# if __cpp_lib_unwrap_ref != 201811L +# error "__cpp_lib_unwrap_ref should have the value 201811L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/hazard_pointer.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/hazard_pointer.version.compile.pass.cpp new file mode 100644 index 0000000000000..f94fa8f98a1bc --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/hazard_pointer.version.compile.pass.cpp @@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_hazard_pointer +# error "__cpp_lib_hazard_pointer should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_hazard_pointer +# error "__cpp_lib_hazard_pointer should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_hazard_pointer +# error "__cpp_lib_hazard_pointer should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_hazard_pointer +# error "__cpp_lib_hazard_pointer should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_hazard_pointer +# error "__cpp_lib_hazard_pointer should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_hazard_pointer +# error "__cpp_lib_hazard_pointer should be defined in c++26" +# endif +# if __cpp_lib_hazard_pointer != 202306L +# error "__cpp_lib_hazard_pointer should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_hazard_pointer +# error "__cpp_lib_hazard_pointer should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/inplace_vector.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/inplace_vector.version.compile.pass.cpp new file mode 100644 index 0000000000000..bc069df7ddc9e --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/inplace_vector.version.compile.pass.cpp @@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_inplace_vector +# error "__cpp_lib_inplace_vector should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_inplace_vector +# error "__cpp_lib_inplace_vector should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_inplace_vector +# error "__cpp_lib_inplace_vector should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_inplace_vector +# error "__cpp_lib_inplace_vector should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_inplace_vector +# error "__cpp_lib_inplace_vector should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_inplace_vector +# error "__cpp_lib_inplace_vector should be defined in c++26" +# endif +# if __cpp_lib_inplace_vector != 202406L +# error "__cpp_lib_inplace_vector should have the value 202406L in c++26" +# endif +# else +# ifdef __cpp_lib_inplace_vector +# error "__cpp_lib_inplace_vector should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/iomanip.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/iomanip.version.compile.pass.cpp new file mode 100644 index 0000000000000..37deba7c9661a --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/iomanip.version.compile.pass.cpp @@ -0,0 +1,107 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-localization + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_quoted_string_io +# error "__cpp_lib_quoted_string_io should not be defined before c++14" +# endif + +#elif TEST_STD_VER == 14 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION +# ifndef __cpp_lib_quoted_string_io +# error "__cpp_lib_quoted_string_io should be defined in c++14" +# endif +# if __cpp_lib_quoted_string_io != 201304L +# error "__cpp_lib_quoted_string_io should have the value 201304L in c++14" +# endif +# else +# ifdef __cpp_lib_quoted_string_io +# error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 17 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION +# ifndef __cpp_lib_quoted_string_io +# error "__cpp_lib_quoted_string_io should be defined in c++17" +# endif +# if __cpp_lib_quoted_string_io != 201304L +# error "__cpp_lib_quoted_string_io should have the value 201304L in c++17" +# endif +# else +# ifdef __cpp_lib_quoted_string_io +# error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION +# ifndef __cpp_lib_quoted_string_io +# error "__cpp_lib_quoted_string_io should be defined in c++20" +# endif +# if __cpp_lib_quoted_string_io != 201304L +# error "__cpp_lib_quoted_string_io should have the value 201304L in c++20" +# endif +# else +# ifdef __cpp_lib_quoted_string_io +# error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION +# ifndef __cpp_lib_quoted_string_io +# error "__cpp_lib_quoted_string_io should be defined in c++23" +# endif +# if __cpp_lib_quoted_string_io != 201304L +# error "__cpp_lib_quoted_string_io should have the value 201304L in c++23" +# endif +# else +# ifdef __cpp_lib_quoted_string_io +# error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION +# ifndef __cpp_lib_quoted_string_io +# error "__cpp_lib_quoted_string_io should be defined in c++26" +# endif +# if __cpp_lib_quoted_string_io != 201304L +# error "__cpp_lib_quoted_string_io should have the value 201304L in c++26" +# endif +# else +# ifdef __cpp_lib_quoted_string_io +# error "__cpp_lib_quoted_string_io should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/ios.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/ios.version.compile.pass.cpp new file mode 100644 index 0000000000000..179c3ce066b6f --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/ios.version.compile.pass.cpp @@ -0,0 +1,68 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-localization + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_ios_noreplace +# error "__cpp_lib_ios_noreplace should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_ios_noreplace +# error "__cpp_lib_ios_noreplace should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_ios_noreplace +# error "__cpp_lib_ios_noreplace should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_ios_noreplace +# error "__cpp_lib_ios_noreplace should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_ios_noreplace +# error "__cpp_lib_ios_noreplace should be defined in c++23" +# endif +# if __cpp_lib_ios_noreplace != 202207L +# error "__cpp_lib_ios_noreplace should have the value 202207L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_ios_noreplace +# error "__cpp_lib_ios_noreplace should be defined in c++26" +# endif +# if __cpp_lib_ios_noreplace != 202207L +# error "__cpp_lib_ios_noreplace should have the value 202207L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/istream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/istream.version.compile.pass.cpp new file mode 100644 index 0000000000000..46238896f79c3 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/istream.version.compile.pass.cpp @@ -0,0 +1,89 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-localization + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++20" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++23" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++26" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/iterator.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/iterator.version.compile.pass.cpp new file mode 100644 index 0000000000000..75dcb18a5428c --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/iterator.version.compile.pass.cpp @@ -0,0 +1,318 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_array_constexpr +# error "__cpp_lib_array_constexpr should not be defined before c++17" +# endif + +# ifdef __cpp_lib_constexpr_iterator +# error "__cpp_lib_constexpr_iterator should not be defined before c++20" +# endif + +# ifdef __cpp_lib_make_reverse_iterator +# error "__cpp_lib_make_reverse_iterator should not be defined before c++14" +# endif + +# ifdef __cpp_lib_move_iterator_concept +# error "__cpp_lib_move_iterator_concept should not be defined before c++20" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +# ifdef __cpp_lib_null_iterators +# error "__cpp_lib_null_iterators should not be defined before c++14" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_ssize +# error "__cpp_lib_ssize should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_array_constexpr +# error "__cpp_lib_array_constexpr should not be defined before c++17" +# endif + +# ifdef __cpp_lib_constexpr_iterator +# error "__cpp_lib_constexpr_iterator should not be defined before c++20" +# endif + +# ifndef __cpp_lib_make_reverse_iterator +# error "__cpp_lib_make_reverse_iterator should be defined in c++14" +# endif +# if __cpp_lib_make_reverse_iterator != 201402L +# error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++14" +# endif + +# ifdef __cpp_lib_move_iterator_concept +# error "__cpp_lib_move_iterator_concept should not be defined before c++20" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +# ifndef __cpp_lib_null_iterators +# error "__cpp_lib_null_iterators should be defined in c++14" +# endif +# if __cpp_lib_null_iterators != 201304L +# error "__cpp_lib_null_iterators should have the value 201304L in c++14" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_ssize +# error "__cpp_lib_ssize should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_array_constexpr +# error "__cpp_lib_array_constexpr should be defined in c++17" +# endif +# if __cpp_lib_array_constexpr != 201603L +# error "__cpp_lib_array_constexpr should have the value 201603L in c++17" +# endif + +# ifdef __cpp_lib_constexpr_iterator +# error "__cpp_lib_constexpr_iterator should not be defined before c++20" +# endif + +# ifndef __cpp_lib_make_reverse_iterator +# error "__cpp_lib_make_reverse_iterator should be defined in c++17" +# endif +# if __cpp_lib_make_reverse_iterator != 201402L +# error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++17" +# endif + +# ifdef __cpp_lib_move_iterator_concept +# error "__cpp_lib_move_iterator_concept should not be defined before c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++17" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" +# endif + +# ifndef __cpp_lib_null_iterators +# error "__cpp_lib_null_iterators should be defined in c++17" +# endif +# if __cpp_lib_null_iterators != 201304L +# error "__cpp_lib_null_iterators should have the value 201304L in c++17" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_ssize +# error "__cpp_lib_ssize should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_array_constexpr +# error "__cpp_lib_array_constexpr should be defined in c++20" +# endif +# if __cpp_lib_array_constexpr != 201811L +# error "__cpp_lib_array_constexpr should have the value 201811L in c++20" +# endif + +# ifndef __cpp_lib_constexpr_iterator +# error "__cpp_lib_constexpr_iterator should be defined in c++20" +# endif +# if __cpp_lib_constexpr_iterator != 201811L +# error "__cpp_lib_constexpr_iterator should have the value 201811L in c++20" +# endif + +# ifndef __cpp_lib_make_reverse_iterator +# error "__cpp_lib_make_reverse_iterator should be defined in c++20" +# endif +# if __cpp_lib_make_reverse_iterator != 201402L +# error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++20" +# endif + +# ifndef __cpp_lib_move_iterator_concept +# error "__cpp_lib_move_iterator_concept should be defined in c++20" +# endif +# if __cpp_lib_move_iterator_concept != 202207L +# error "__cpp_lib_move_iterator_concept should have the value 202207L in c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++20" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" +# endif + +# ifndef __cpp_lib_null_iterators +# error "__cpp_lib_null_iterators should be defined in c++20" +# endif +# if __cpp_lib_null_iterators != 201304L +# error "__cpp_lib_null_iterators should have the value 201304L in c++20" +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++20" +# endif +# if __cpp_lib_ranges != 202110L +# error "__cpp_lib_ranges should have the value 202110L in c++20" +# endif + +# ifndef __cpp_lib_ssize +# error "__cpp_lib_ssize should be defined in c++20" +# endif +# if __cpp_lib_ssize != 201902L +# error "__cpp_lib_ssize should have the value 201902L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_array_constexpr +# error "__cpp_lib_array_constexpr should be defined in c++23" +# endif +# if __cpp_lib_array_constexpr != 201811L +# error "__cpp_lib_array_constexpr should have the value 201811L in c++23" +# endif + +# ifndef __cpp_lib_constexpr_iterator +# error "__cpp_lib_constexpr_iterator should be defined in c++23" +# endif +# if __cpp_lib_constexpr_iterator != 201811L +# error "__cpp_lib_constexpr_iterator should have the value 201811L in c++23" +# endif + +# ifndef __cpp_lib_make_reverse_iterator +# error "__cpp_lib_make_reverse_iterator should be defined in c++23" +# endif +# if __cpp_lib_make_reverse_iterator != 201402L +# error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++23" +# endif + +# ifndef __cpp_lib_move_iterator_concept +# error "__cpp_lib_move_iterator_concept should be defined in c++23" +# endif +# if __cpp_lib_move_iterator_concept != 202207L +# error "__cpp_lib_move_iterator_concept should have the value 202207L in c++23" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++23" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" +# endif + +# ifndef __cpp_lib_null_iterators +# error "__cpp_lib_null_iterators should be defined in c++23" +# endif +# if __cpp_lib_null_iterators != 201304L +# error "__cpp_lib_null_iterators should have the value 201304L in c++23" +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++23" +# endif +# if __cpp_lib_ranges != 202406L +# error "__cpp_lib_ranges should have the value 202406L in c++23" +# endif + +# ifndef __cpp_lib_ssize +# error "__cpp_lib_ssize should be defined in c++23" +# endif +# if __cpp_lib_ssize != 201902L +# error "__cpp_lib_ssize should have the value 201902L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_array_constexpr +# error "__cpp_lib_array_constexpr should be defined in c++26" +# endif +# if __cpp_lib_array_constexpr != 201811L +# error "__cpp_lib_array_constexpr should have the value 201811L in c++26" +# endif + +# ifndef __cpp_lib_constexpr_iterator +# error "__cpp_lib_constexpr_iterator should be defined in c++26" +# endif +# if __cpp_lib_constexpr_iterator != 201811L +# error "__cpp_lib_constexpr_iterator should have the value 201811L in c++26" +# endif + +# ifndef __cpp_lib_make_reverse_iterator +# error "__cpp_lib_make_reverse_iterator should be defined in c++26" +# endif +# if __cpp_lib_make_reverse_iterator != 201402L +# error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++26" +# endif + +# ifndef __cpp_lib_move_iterator_concept +# error "__cpp_lib_move_iterator_concept should be defined in c++26" +# endif +# if __cpp_lib_move_iterator_concept != 202207L +# error "__cpp_lib_move_iterator_concept should have the value 202207L in c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++26" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" +# endif + +# ifndef __cpp_lib_null_iterators +# error "__cpp_lib_null_iterators should be defined in c++26" +# endif +# if __cpp_lib_null_iterators != 201304L +# error "__cpp_lib_null_iterators should have the value 201304L in c++26" +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++26" +# endif +# if __cpp_lib_ranges != 202406L +# error "__cpp_lib_ranges should have the value 202406L in c++26" +# endif + +# ifndef __cpp_lib_ssize +# error "__cpp_lib_ssize should be defined in c++26" +# endif +# if __cpp_lib_ssize != 201902L +# error "__cpp_lib_ssize should have the value 201902L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/latch.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/latch.version.compile.pass.cpp new file mode 100644 index 0000000000000..6857c54460650 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/latch.version.compile.pass.cpp @@ -0,0 +1,89 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-threads + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_latch +# error "__cpp_lib_latch should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_latch +# error "__cpp_lib_latch should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_latch +# error "__cpp_lib_latch should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_latch +# error "__cpp_lib_latch should be defined in c++20" +# endif +# if __cpp_lib_latch != 201907L +# error "__cpp_lib_latch should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_latch +# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_latch +# error "__cpp_lib_latch should be defined in c++23" +# endif +# if __cpp_lib_latch != 201907L +# error "__cpp_lib_latch should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_latch +# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_latch +# error "__cpp_lib_latch should be defined in c++26" +# endif +# if __cpp_lib_latch != 201907L +# error "__cpp_lib_latch should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_latch +# error "__cpp_lib_latch should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/limits.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/limits.version.compile.pass.cpp new file mode 100644 index 0000000000000..0b3d6f5d2bd9c --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/limits.version.compile.pass.cpp @@ -0,0 +1,87 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++20" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++23" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++26" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/linalg.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/linalg.version.compile.pass.cpp new file mode 100644 index 0000000000000..0845e9022a18c --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/linalg.version.compile.pass.cpp @@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_linalg +# error "__cpp_lib_linalg should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_linalg +# error "__cpp_lib_linalg should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_linalg +# error "__cpp_lib_linalg should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_linalg +# error "__cpp_lib_linalg should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_linalg +# error "__cpp_lib_linalg should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_linalg +# error "__cpp_lib_linalg should be defined in c++26" +# endif +# if __cpp_lib_linalg != 202311L +# error "__cpp_lib_linalg should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_linalg +# error "__cpp_lib_linalg should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/list.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/list.version.compile.pass.cpp new file mode 100644 index 0000000000000..9fd638087fcea --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/list.version.compile.pass.cpp @@ -0,0 +1,273 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should not be defined before c++17" +# endif + +# ifdef __cpp_lib_list_remove_return_type +# error "__cpp_lib_list_remove_return_type should not be defined before c++20" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should not be defined before c++17" +# endif + +# ifdef __cpp_lib_list_remove_return_type +# error "__cpp_lib_list_remove_return_type should not be defined before c++20" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifndef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should be defined in c++17" +# endif +# if __cpp_lib_incomplete_container_elements != 201505L +# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17" +# endif + +# ifdef __cpp_lib_list_remove_return_type +# error "__cpp_lib_list_remove_return_type should not be defined before c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++17" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++20" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++20" +# endif + +# ifndef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should be defined in c++20" +# endif +# if __cpp_lib_incomplete_container_elements != 201505L +# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20" +# endif + +# ifndef __cpp_lib_list_remove_return_type +# error "__cpp_lib_list_remove_return_type should be defined in c++20" +# endif +# if __cpp_lib_list_remove_return_type != 201806L +# error "__cpp_lib_list_remove_return_type should have the value 201806L in c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++20" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++23" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++23" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++23" +# endif + +# ifndef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should be defined in c++23" +# endif +# if __cpp_lib_incomplete_container_elements != 201505L +# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23" +# endif + +# ifndef __cpp_lib_list_remove_return_type +# error "__cpp_lib_list_remove_return_type should be defined in c++23" +# endif +# if __cpp_lib_list_remove_return_type != 201806L +# error "__cpp_lib_list_remove_return_type should have the value 201806L in c++23" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++23" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++26" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26" +# endif +# if __cpp_lib_default_template_type_for_algorithm_values != 202403L +# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++26" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++26" +# endif + +# ifndef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should be defined in c++26" +# endif +# if __cpp_lib_incomplete_container_elements != 201505L +# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26" +# endif + +# ifndef __cpp_lib_list_remove_return_type +# error "__cpp_lib_list_remove_return_type should be defined in c++26" +# endif +# if __cpp_lib_list_remove_return_type != 201806L +# error "__cpp_lib_list_remove_return_type should have the value 201806L in c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++26" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/locale.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/locale.version.compile.pass.cpp new file mode 100644 index 0000000000000..e1a04d1b0e087 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/locale.version.compile.pass.cpp @@ -0,0 +1,89 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-localization + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++20" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++23" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++26" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/map.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/map.version.compile.pass.cpp new file mode 100644 index 0000000000000..4044c2b1b2e0f --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/map.version.compile.pass.cpp @@ -0,0 +1,399 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_generic_associative_lookup +# error "__cpp_lib_generic_associative_lookup should not be defined before c++14" +# endif + +# ifdef __cpp_lib_map_try_emplace +# error "__cpp_lib_map_try_emplace should not be defined before c++17" +# endif + +# ifdef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should not be defined before c++17" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifndef __cpp_lib_generic_associative_lookup +# error "__cpp_lib_generic_associative_lookup should be defined in c++14" +# endif +# if __cpp_lib_generic_associative_lookup != 201304L +# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14" +# endif + +# ifdef __cpp_lib_map_try_emplace +# error "__cpp_lib_map_try_emplace should not be defined before c++17" +# endif + +# ifdef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should not be defined before c++17" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifndef __cpp_lib_generic_associative_lookup +# error "__cpp_lib_generic_associative_lookup should be defined in c++17" +# endif +# if __cpp_lib_generic_associative_lookup != 201304L +# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17" +# endif + +# ifndef __cpp_lib_map_try_emplace +# error "__cpp_lib_map_try_emplace should be defined in c++17" +# endif +# if __cpp_lib_map_try_emplace != 201411L +# error "__cpp_lib_map_try_emplace should have the value 201411L in c++17" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++17" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++17" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++17" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++20" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++20" +# endif + +# ifndef __cpp_lib_generic_associative_lookup +# error "__cpp_lib_generic_associative_lookup should be defined in c++20" +# endif +# if __cpp_lib_generic_associative_lookup != 201304L +# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++20" +# endif + +# ifndef __cpp_lib_map_try_emplace +# error "__cpp_lib_map_try_emplace should be defined in c++20" +# endif +# if __cpp_lib_map_try_emplace != 201411L +# error "__cpp_lib_map_try_emplace should have the value 201411L in c++20" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++20" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++20" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23" +# endif +# if __cpp_lib_associative_heterogeneous_erasure != 202110L +# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23" +# endif +# else +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++23" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++23" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++23" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++23" +# endif + +# ifndef __cpp_lib_generic_associative_lookup +# error "__cpp_lib_generic_associative_lookup should be defined in c++23" +# endif +# if __cpp_lib_generic_associative_lookup != 201304L +# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++23" +# endif + +# ifndef __cpp_lib_map_try_emplace +# error "__cpp_lib_map_try_emplace should be defined in c++23" +# endif +# if __cpp_lib_map_try_emplace != 201411L +# error "__cpp_lib_map_try_emplace should have the value 201411L in c++23" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++23" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++23" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++23" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should be defined in c++23" +# endif +# if __cpp_lib_tuple_like != 202207L +# error "__cpp_lib_tuple_like should have the value 202207L in c++23" +# endif +# else +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26" +# endif +# if __cpp_lib_associative_heterogeneous_erasure != 202110L +# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26" +# endif +# else +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26" +# endif +# if __cpp_lib_associative_heterogeneous_insertion != 202306L +# error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++26" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++26" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++26" +# endif + +# ifndef __cpp_lib_generic_associative_lookup +# error "__cpp_lib_generic_associative_lookup should be defined in c++26" +# endif +# if __cpp_lib_generic_associative_lookup != 201304L +# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++26" +# endif + +# ifndef __cpp_lib_map_try_emplace +# error "__cpp_lib_map_try_emplace should be defined in c++26" +# endif +# if __cpp_lib_map_try_emplace != 201411L +# error "__cpp_lib_map_try_emplace should have the value 201411L in c++26" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++26" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++26" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should be defined in c++26" +# endif +# if __cpp_lib_tuple_like != 202311L +# error "__cpp_lib_tuple_like should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/mdspan.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/mdspan.version.compile.pass.cpp new file mode 100644 index 0000000000000..28524438f644b --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/mdspan.version.compile.pass.cpp @@ -0,0 +1,132 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_freestanding_mdspan +# error "__cpp_lib_freestanding_mdspan should not be defined before c++26" +# endif + +# ifdef __cpp_lib_mdspan +# error "__cpp_lib_mdspan should not be defined before c++23" +# endif + +# ifdef __cpp_lib_submdspan +# error "__cpp_lib_submdspan should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_freestanding_mdspan +# error "__cpp_lib_freestanding_mdspan should not be defined before c++26" +# endif + +# ifdef __cpp_lib_mdspan +# error "__cpp_lib_mdspan should not be defined before c++23" +# endif + +# ifdef __cpp_lib_submdspan +# error "__cpp_lib_submdspan should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_freestanding_mdspan +# error "__cpp_lib_freestanding_mdspan should not be defined before c++26" +# endif + +# ifdef __cpp_lib_mdspan +# error "__cpp_lib_mdspan should not be defined before c++23" +# endif + +# ifdef __cpp_lib_submdspan +# error "__cpp_lib_submdspan should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_freestanding_mdspan +# error "__cpp_lib_freestanding_mdspan should not be defined before c++26" +# endif + +# ifdef __cpp_lib_mdspan +# error "__cpp_lib_mdspan should not be defined before c++23" +# endif + +# ifdef __cpp_lib_submdspan +# error "__cpp_lib_submdspan should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_freestanding_mdspan +# error "__cpp_lib_freestanding_mdspan should not be defined before c++26" +# endif + +# ifndef __cpp_lib_mdspan +# error "__cpp_lib_mdspan should be defined in c++23" +# endif +# if __cpp_lib_mdspan != 202207L +# error "__cpp_lib_mdspan should have the value 202207L in c++23" +# endif + +# ifdef __cpp_lib_submdspan +# error "__cpp_lib_submdspan should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_freestanding_mdspan +# error "__cpp_lib_freestanding_mdspan should be defined in c++26" +# endif +# if __cpp_lib_freestanding_mdspan != 202311L +# error "__cpp_lib_freestanding_mdspan should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_freestanding_mdspan +# error "__cpp_lib_freestanding_mdspan should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_mdspan +# error "__cpp_lib_mdspan should be defined in c++26" +# endif +# if __cpp_lib_mdspan != 202406L +# error "__cpp_lib_mdspan should have the value 202406L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_submdspan +# error "__cpp_lib_submdspan should be defined in c++26" +# endif +# if __cpp_lib_submdspan != 202306L +# error "__cpp_lib_submdspan should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_submdspan +# error "__cpp_lib_submdspan should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/memory.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/memory.version.compile.pass.cpp new file mode 100644 index 0000000000000..fc70df3ae2ef9 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/memory.version.compile.pass.cpp @@ -0,0 +1,654 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_addressof_constexpr +# error "__cpp_lib_addressof_constexpr should not be defined before c++17" +# endif + +# ifdef __cpp_lib_allocate_at_least +# error "__cpp_lib_allocate_at_least should not be defined before c++23" +# endif + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_assume_aligned +# error "__cpp_lib_assume_aligned should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_value_initialization +# error "__cpp_lib_atomic_value_initialization should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_dynamic_alloc +# error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_memory +# error "__cpp_lib_constexpr_memory should not be defined before c++20" +# endif + +# ifdef __cpp_lib_enable_shared_from_this +# error "__cpp_lib_enable_shared_from_this should not be defined before c++17" +# endif + +# ifdef __cpp_lib_make_unique +# error "__cpp_lib_make_unique should not be defined before c++14" +# endif + +# ifdef __cpp_lib_out_ptr +# error "__cpp_lib_out_ptr should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_raw_memory_algorithms +# error "__cpp_lib_raw_memory_algorithms should not be defined before c++17" +# endif + +# ifdef __cpp_lib_shared_ptr_arrays +# error "__cpp_lib_shared_ptr_arrays should not be defined before c++17" +# endif + +# ifdef __cpp_lib_shared_ptr_weak_type +# error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17" +# endif + +# ifdef __cpp_lib_smart_ptr_for_overwrite +# error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20" +# endif + +# ifdef __cpp_lib_smart_ptr_owner_equality +# error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_to_address +# error "__cpp_lib_to_address should not be defined before c++20" +# endif + +# ifdef __cpp_lib_transparent_operators +# error "__cpp_lib_transparent_operators should not be defined before c++14" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_addressof_constexpr +# error "__cpp_lib_addressof_constexpr should not be defined before c++17" +# endif + +# ifdef __cpp_lib_allocate_at_least +# error "__cpp_lib_allocate_at_least should not be defined before c++23" +# endif + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_assume_aligned +# error "__cpp_lib_assume_aligned should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_value_initialization +# error "__cpp_lib_atomic_value_initialization should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_dynamic_alloc +# error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_memory +# error "__cpp_lib_constexpr_memory should not be defined before c++20" +# endif + +# ifdef __cpp_lib_enable_shared_from_this +# error "__cpp_lib_enable_shared_from_this should not be defined before c++17" +# endif + +# ifndef __cpp_lib_make_unique +# error "__cpp_lib_make_unique should be defined in c++14" +# endif +# if __cpp_lib_make_unique != 201304L +# error "__cpp_lib_make_unique should have the value 201304L in c++14" +# endif + +# ifdef __cpp_lib_out_ptr +# error "__cpp_lib_out_ptr should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_raw_memory_algorithms +# error "__cpp_lib_raw_memory_algorithms should not be defined before c++17" +# endif + +# ifdef __cpp_lib_shared_ptr_arrays +# error "__cpp_lib_shared_ptr_arrays should not be defined before c++17" +# endif + +# ifdef __cpp_lib_shared_ptr_weak_type +# error "__cpp_lib_shared_ptr_weak_type should not be defined before c++17" +# endif + +# ifdef __cpp_lib_smart_ptr_for_overwrite +# error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20" +# endif + +# ifdef __cpp_lib_smart_ptr_owner_equality +# error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_to_address +# error "__cpp_lib_to_address should not be defined before c++20" +# endif + +# ifndef __cpp_lib_transparent_operators +# error "__cpp_lib_transparent_operators should be defined in c++14" +# endif +# if __cpp_lib_transparent_operators != 201210L +# error "__cpp_lib_transparent_operators should have the value 201210L in c++14" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_addressof_constexpr +# error "__cpp_lib_addressof_constexpr should be defined in c++17" +# endif +# if __cpp_lib_addressof_constexpr != 201603L +# error "__cpp_lib_addressof_constexpr should have the value 201603L in c++17" +# endif + +# ifdef __cpp_lib_allocate_at_least +# error "__cpp_lib_allocate_at_least should not be defined before c++23" +# endif + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_assume_aligned +# error "__cpp_lib_assume_aligned should not be defined before c++20" +# endif + +# ifdef __cpp_lib_atomic_value_initialization +# error "__cpp_lib_atomic_value_initialization should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_dynamic_alloc +# error "__cpp_lib_constexpr_dynamic_alloc should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_memory +# error "__cpp_lib_constexpr_memory should not be defined before c++20" +# endif + +# ifndef __cpp_lib_enable_shared_from_this +# error "__cpp_lib_enable_shared_from_this should be defined in c++17" +# endif +# if __cpp_lib_enable_shared_from_this != 201603L +# error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++17" +# endif + +# ifndef __cpp_lib_make_unique +# error "__cpp_lib_make_unique should be defined in c++17" +# endif +# if __cpp_lib_make_unique != 201304L +# error "__cpp_lib_make_unique should have the value 201304L in c++17" +# endif + +# ifdef __cpp_lib_out_ptr +# error "__cpp_lib_out_ptr should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifndef __cpp_lib_raw_memory_algorithms +# error "__cpp_lib_raw_memory_algorithms should be defined in c++17" +# endif +# if __cpp_lib_raw_memory_algorithms != 201606L +# error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++17" +# endif + +# ifndef __cpp_lib_shared_ptr_arrays +# error "__cpp_lib_shared_ptr_arrays should be defined in c++17" +# endif +# if __cpp_lib_shared_ptr_arrays != 201611L +# error "__cpp_lib_shared_ptr_arrays should have the value 201611L in c++17" +# endif + +# ifndef __cpp_lib_shared_ptr_weak_type +# error "__cpp_lib_shared_ptr_weak_type should be defined in c++17" +# endif +# if __cpp_lib_shared_ptr_weak_type != 201606L +# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++17" +# endif + +# ifdef __cpp_lib_smart_ptr_for_overwrite +# error "__cpp_lib_smart_ptr_for_overwrite should not be defined before c++20" +# endif + +# ifdef __cpp_lib_smart_ptr_owner_equality +# error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_to_address +# error "__cpp_lib_to_address should not be defined before c++20" +# endif + +# ifndef __cpp_lib_transparent_operators +# error "__cpp_lib_transparent_operators should be defined in c++17" +# endif +# if __cpp_lib_transparent_operators != 201510L +# error "__cpp_lib_transparent_operators should have the value 201510L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_addressof_constexpr +# error "__cpp_lib_addressof_constexpr should be defined in c++20" +# endif +# if __cpp_lib_addressof_constexpr != 201603L +# error "__cpp_lib_addressof_constexpr should have the value 201603L in c++20" +# endif + +# ifdef __cpp_lib_allocate_at_least +# error "__cpp_lib_allocate_at_least should not be defined before c++23" +# endif + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" +# endif + +# ifndef __cpp_lib_assume_aligned +# error "__cpp_lib_assume_aligned should be defined in c++20" +# endif +# if __cpp_lib_assume_aligned != 201811L +# error "__cpp_lib_assume_aligned should have the value 201811L in c++20" +# endif + +# ifndef __cpp_lib_atomic_value_initialization +# error "__cpp_lib_atomic_value_initialization should be defined in c++20" +# endif +# if __cpp_lib_atomic_value_initialization != 201911L +# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++20" +# endif + +# ifndef __cpp_lib_constexpr_dynamic_alloc +# error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++20" +# endif +# if __cpp_lib_constexpr_dynamic_alloc != 201907L +# error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++20" +# endif + +# ifndef __cpp_lib_constexpr_memory +# error "__cpp_lib_constexpr_memory should be defined in c++20" +# endif +# if __cpp_lib_constexpr_memory != 201811L +# error "__cpp_lib_constexpr_memory should have the value 201811L in c++20" +# endif + +# ifndef __cpp_lib_enable_shared_from_this +# error "__cpp_lib_enable_shared_from_this should be defined in c++20" +# endif +# if __cpp_lib_enable_shared_from_this != 201603L +# error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++20" +# endif + +# ifndef __cpp_lib_make_unique +# error "__cpp_lib_make_unique should be defined in c++20" +# endif +# if __cpp_lib_make_unique != 201304L +# error "__cpp_lib_make_unique should have the value 201304L in c++20" +# endif + +# ifdef __cpp_lib_out_ptr +# error "__cpp_lib_out_ptr should not be defined before c++23" +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++20" +# endif +# if __cpp_lib_ranges != 202110L +# error "__cpp_lib_ranges should have the value 202110L in c++20" +# endif + +# ifndef __cpp_lib_raw_memory_algorithms +# error "__cpp_lib_raw_memory_algorithms should be defined in c++20" +# endif +# if __cpp_lib_raw_memory_algorithms != 201606L +# error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++20" +# endif + +# ifndef __cpp_lib_shared_ptr_arrays +# error "__cpp_lib_shared_ptr_arrays should be defined in c++20" +# endif +# if __cpp_lib_shared_ptr_arrays != 201707L +# error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++20" +# endif + +# ifndef __cpp_lib_shared_ptr_weak_type +# error "__cpp_lib_shared_ptr_weak_type should be defined in c++20" +# endif +# if __cpp_lib_shared_ptr_weak_type != 201606L +# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++20" +# endif + +# ifndef __cpp_lib_smart_ptr_for_overwrite +# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++20" +# endif +# if __cpp_lib_smart_ptr_for_overwrite != 202002L +# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++20" +# endif + +# ifdef __cpp_lib_smart_ptr_owner_equality +# error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26" +# endif + +# ifndef __cpp_lib_to_address +# error "__cpp_lib_to_address should be defined in c++20" +# endif +# if __cpp_lib_to_address != 201711L +# error "__cpp_lib_to_address should have the value 201711L in c++20" +# endif + +# ifndef __cpp_lib_transparent_operators +# error "__cpp_lib_transparent_operators should be defined in c++20" +# endif +# if __cpp_lib_transparent_operators != 201510L +# error "__cpp_lib_transparent_operators should have the value 201510L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_addressof_constexpr +# error "__cpp_lib_addressof_constexpr should be defined in c++23" +# endif +# if __cpp_lib_addressof_constexpr != 201603L +# error "__cpp_lib_addressof_constexpr should have the value 201603L in c++23" +# endif + +# ifndef __cpp_lib_allocate_at_least +# error "__cpp_lib_allocate_at_least should be defined in c++23" +# endif +# if __cpp_lib_allocate_at_least != 202302L +# error "__cpp_lib_allocate_at_least should have the value 202302L in c++23" +# endif + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" +# endif + +# ifndef __cpp_lib_assume_aligned +# error "__cpp_lib_assume_aligned should be defined in c++23" +# endif +# if __cpp_lib_assume_aligned != 201811L +# error "__cpp_lib_assume_aligned should have the value 201811L in c++23" +# endif + +# ifndef __cpp_lib_atomic_value_initialization +# error "__cpp_lib_atomic_value_initialization should be defined in c++23" +# endif +# if __cpp_lib_atomic_value_initialization != 201911L +# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++23" +# endif + +# ifndef __cpp_lib_constexpr_dynamic_alloc +# error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++23" +# endif +# if __cpp_lib_constexpr_dynamic_alloc != 201907L +# error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++23" +# endif + +# ifndef __cpp_lib_constexpr_memory +# error "__cpp_lib_constexpr_memory should be defined in c++23" +# endif +# if __cpp_lib_constexpr_memory != 202202L +# error "__cpp_lib_constexpr_memory should have the value 202202L in c++23" +# endif + +# ifndef __cpp_lib_enable_shared_from_this +# error "__cpp_lib_enable_shared_from_this should be defined in c++23" +# endif +# if __cpp_lib_enable_shared_from_this != 201603L +# error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++23" +# endif + +# ifndef __cpp_lib_make_unique +# error "__cpp_lib_make_unique should be defined in c++23" +# endif +# if __cpp_lib_make_unique != 201304L +# error "__cpp_lib_make_unique should have the value 201304L in c++23" +# endif + +# ifndef __cpp_lib_out_ptr +# error "__cpp_lib_out_ptr should be defined in c++23" +# endif +# if __cpp_lib_out_ptr != 202106L +# error "__cpp_lib_out_ptr should have the value 202106L in c++23" +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++23" +# endif +# if __cpp_lib_ranges != 202406L +# error "__cpp_lib_ranges should have the value 202406L in c++23" +# endif + +# ifndef __cpp_lib_raw_memory_algorithms +# error "__cpp_lib_raw_memory_algorithms should be defined in c++23" +# endif +# if __cpp_lib_raw_memory_algorithms != 201606L +# error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++23" +# endif + +# ifndef __cpp_lib_shared_ptr_arrays +# error "__cpp_lib_shared_ptr_arrays should be defined in c++23" +# endif +# if __cpp_lib_shared_ptr_arrays != 201707L +# error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++23" +# endif + +# ifndef __cpp_lib_shared_ptr_weak_type +# error "__cpp_lib_shared_ptr_weak_type should be defined in c++23" +# endif +# if __cpp_lib_shared_ptr_weak_type != 201606L +# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++23" +# endif + +# ifndef __cpp_lib_smart_ptr_for_overwrite +# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++23" +# endif +# if __cpp_lib_smart_ptr_for_overwrite != 202002L +# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++23" +# endif + +# ifdef __cpp_lib_smart_ptr_owner_equality +# error "__cpp_lib_smart_ptr_owner_equality should not be defined before c++26" +# endif + +# ifndef __cpp_lib_to_address +# error "__cpp_lib_to_address should be defined in c++23" +# endif +# if __cpp_lib_to_address != 201711L +# error "__cpp_lib_to_address should have the value 201711L in c++23" +# endif + +# ifndef __cpp_lib_transparent_operators +# error "__cpp_lib_transparent_operators should be defined in c++23" +# endif +# if __cpp_lib_transparent_operators != 201510L +# error "__cpp_lib_transparent_operators should have the value 201510L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_addressof_constexpr +# error "__cpp_lib_addressof_constexpr should be defined in c++26" +# endif +# if __cpp_lib_addressof_constexpr != 201603L +# error "__cpp_lib_addressof_constexpr should have the value 201603L in c++26" +# endif + +# ifndef __cpp_lib_allocate_at_least +# error "__cpp_lib_allocate_at_least should be defined in c++26" +# endif +# if __cpp_lib_allocate_at_least != 202302L +# error "__cpp_lib_allocate_at_least should have the value 202302L in c++26" +# endif + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" +# endif + +# ifndef __cpp_lib_assume_aligned +# error "__cpp_lib_assume_aligned should be defined in c++26" +# endif +# if __cpp_lib_assume_aligned != 201811L +# error "__cpp_lib_assume_aligned should have the value 201811L in c++26" +# endif + +# ifndef __cpp_lib_atomic_value_initialization +# error "__cpp_lib_atomic_value_initialization should be defined in c++26" +# endif +# if __cpp_lib_atomic_value_initialization != 201911L +# error "__cpp_lib_atomic_value_initialization should have the value 201911L in c++26" +# endif + +# ifndef __cpp_lib_constexpr_dynamic_alloc +# error "__cpp_lib_constexpr_dynamic_alloc should be defined in c++26" +# endif +# if __cpp_lib_constexpr_dynamic_alloc != 201907L +# error "__cpp_lib_constexpr_dynamic_alloc should have the value 201907L in c++26" +# endif + +# ifndef __cpp_lib_constexpr_memory +# error "__cpp_lib_constexpr_memory should be defined in c++26" +# endif +# if __cpp_lib_constexpr_memory != 202202L +# error "__cpp_lib_constexpr_memory should have the value 202202L in c++26" +# endif + +# ifndef __cpp_lib_enable_shared_from_this +# error "__cpp_lib_enable_shared_from_this should be defined in c++26" +# endif +# if __cpp_lib_enable_shared_from_this != 201603L +# error "__cpp_lib_enable_shared_from_this should have the value 201603L in c++26" +# endif + +# ifndef __cpp_lib_make_unique +# error "__cpp_lib_make_unique should be defined in c++26" +# endif +# if __cpp_lib_make_unique != 201304L +# error "__cpp_lib_make_unique should have the value 201304L in c++26" +# endif + +# ifndef __cpp_lib_out_ptr +# error "__cpp_lib_out_ptr should be defined in c++26" +# endif +# if __cpp_lib_out_ptr != 202311L +# error "__cpp_lib_out_ptr should have the value 202311L in c++26" +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++26" +# endif +# if __cpp_lib_ranges != 202406L +# error "__cpp_lib_ranges should have the value 202406L in c++26" +# endif + +# ifndef __cpp_lib_raw_memory_algorithms +# error "__cpp_lib_raw_memory_algorithms should be defined in c++26" +# endif +# if __cpp_lib_raw_memory_algorithms != 201606L +# error "__cpp_lib_raw_memory_algorithms should have the value 201606L in c++26" +# endif + +# ifndef __cpp_lib_shared_ptr_arrays +# error "__cpp_lib_shared_ptr_arrays should be defined in c++26" +# endif +# if __cpp_lib_shared_ptr_arrays != 201707L +# error "__cpp_lib_shared_ptr_arrays should have the value 201707L in c++26" +# endif + +# ifndef __cpp_lib_shared_ptr_weak_type +# error "__cpp_lib_shared_ptr_weak_type should be defined in c++26" +# endif +# if __cpp_lib_shared_ptr_weak_type != 201606L +# error "__cpp_lib_shared_ptr_weak_type should have the value 201606L in c++26" +# endif + +# ifndef __cpp_lib_smart_ptr_for_overwrite +# error "__cpp_lib_smart_ptr_for_overwrite should be defined in c++26" +# endif +# if __cpp_lib_smart_ptr_for_overwrite != 202002L +# error "__cpp_lib_smart_ptr_for_overwrite should have the value 202002L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_smart_ptr_owner_equality +# error "__cpp_lib_smart_ptr_owner_equality should be defined in c++26" +# endif +# if __cpp_lib_smart_ptr_owner_equality != 202306L +# error "__cpp_lib_smart_ptr_owner_equality should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_smart_ptr_owner_equality +# error "__cpp_lib_smart_ptr_owner_equality should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_to_address +# error "__cpp_lib_to_address should be defined in c++26" +# endif +# if __cpp_lib_to_address != 201711L +# error "__cpp_lib_to_address should have the value 201711L in c++26" +# endif + +# ifndef __cpp_lib_transparent_operators +# error "__cpp_lib_transparent_operators should be defined in c++26" +# endif +# if __cpp_lib_transparent_operators != 201510L +# error "__cpp_lib_transparent_operators should have the value 201510L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/memory_resource.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/memory_resource.version.compile.pass.cpp new file mode 100644 index 0000000000000..52fc2d1854fec --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/memory_resource.version.compile.pass.cpp @@ -0,0 +1,147 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_memory_resource +# error "__cpp_lib_memory_resource should not be defined before c++17" +# endif + +# ifdef __cpp_lib_polymorphic_allocator +# error "__cpp_lib_polymorphic_allocator should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_memory_resource +# error "__cpp_lib_memory_resource should not be defined before c++17" +# endif + +# ifdef __cpp_lib_polymorphic_allocator +# error "__cpp_lib_polymorphic_allocator should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR +# ifndef __cpp_lib_memory_resource +# error "__cpp_lib_memory_resource should be defined in c++17" +# endif +# if __cpp_lib_memory_resource != 201603L +# error "__cpp_lib_memory_resource should have the value 201603L in c++17" +# endif +# else +# ifdef __cpp_lib_memory_resource +# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!" +# endif +# endif + +# ifdef __cpp_lib_polymorphic_allocator +# error "__cpp_lib_polymorphic_allocator should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR +# ifndef __cpp_lib_memory_resource +# error "__cpp_lib_memory_resource should be defined in c++20" +# endif +# if __cpp_lib_memory_resource != 201603L +# error "__cpp_lib_memory_resource should have the value 201603L in c++20" +# endif +# else +# ifdef __cpp_lib_memory_resource +# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR +# ifndef __cpp_lib_polymorphic_allocator +# error "__cpp_lib_polymorphic_allocator should be defined in c++20" +# endif +# if __cpp_lib_polymorphic_allocator != 201902L +# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++20" +# endif +# else +# ifdef __cpp_lib_polymorphic_allocator +# error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR +# ifndef __cpp_lib_memory_resource +# error "__cpp_lib_memory_resource should be defined in c++23" +# endif +# if __cpp_lib_memory_resource != 201603L +# error "__cpp_lib_memory_resource should have the value 201603L in c++23" +# endif +# else +# ifdef __cpp_lib_memory_resource +# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR +# ifndef __cpp_lib_polymorphic_allocator +# error "__cpp_lib_polymorphic_allocator should be defined in c++23" +# endif +# if __cpp_lib_polymorphic_allocator != 201902L +# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++23" +# endif +# else +# ifdef __cpp_lib_polymorphic_allocator +# error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR +# ifndef __cpp_lib_memory_resource +# error "__cpp_lib_memory_resource should be defined in c++26" +# endif +# if __cpp_lib_memory_resource != 201603L +# error "__cpp_lib_memory_resource should have the value 201603L in c++26" +# endif +# else +# ifdef __cpp_lib_memory_resource +# error "__cpp_lib_memory_resource should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR +# ifndef __cpp_lib_polymorphic_allocator +# error "__cpp_lib_polymorphic_allocator should be defined in c++26" +# endif +# if __cpp_lib_polymorphic_allocator != 201902L +# error "__cpp_lib_polymorphic_allocator should have the value 201902L in c++26" +# endif +# else +# ifdef __cpp_lib_polymorphic_allocator +# error "__cpp_lib_polymorphic_allocator should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/mutex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/mutex.version.compile.pass.cpp new file mode 100644 index 0000000000000..fb3734fff10e5 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/mutex.version.compile.pass.cpp @@ -0,0 +1,98 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-threads + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_scoped_lock +# error "__cpp_lib_scoped_lock should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_scoped_lock +# error "__cpp_lib_scoped_lock should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_scoped_lock +# error "__cpp_lib_scoped_lock should be defined in c++17" +# endif +# if __cpp_lib_scoped_lock != 201703L +# error "__cpp_lib_scoped_lock should have the value 201703L in c++17" +# endif +# else +# ifdef __cpp_lib_scoped_lock +# error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_scoped_lock +# error "__cpp_lib_scoped_lock should be defined in c++20" +# endif +# if __cpp_lib_scoped_lock != 201703L +# error "__cpp_lib_scoped_lock should have the value 201703L in c++20" +# endif +# else +# ifdef __cpp_lib_scoped_lock +# error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_scoped_lock +# error "__cpp_lib_scoped_lock should be defined in c++23" +# endif +# if __cpp_lib_scoped_lock != 201703L +# error "__cpp_lib_scoped_lock should have the value 201703L in c++23" +# endif +# else +# ifdef __cpp_lib_scoped_lock +# error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_scoped_lock +# error "__cpp_lib_scoped_lock should be defined in c++26" +# endif +# if __cpp_lib_scoped_lock != 201703L +# error "__cpp_lib_scoped_lock should have the value 201703L in c++26" +# endif +# else +# ifdef __cpp_lib_scoped_lock +# error "__cpp_lib_scoped_lock should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/new.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/new.version.compile.pass.cpp new file mode 100644 index 0000000000000..b1de3f7629e9d --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/new.version.compile.pass.cpp @@ -0,0 +1,216 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_constexpr_new +# error "__cpp_lib_constexpr_new should not be defined before c++26" +# endif + +# ifdef __cpp_lib_destroying_delete +# error "__cpp_lib_destroying_delete should not be defined before c++20" +# endif + +# ifdef __cpp_lib_hardware_interference_size +# error "__cpp_lib_hardware_interference_size should not be defined before c++17" +# endif + +# ifdef __cpp_lib_launder +# error "__cpp_lib_launder should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_constexpr_new +# error "__cpp_lib_constexpr_new should not be defined before c++26" +# endif + +# ifdef __cpp_lib_destroying_delete +# error "__cpp_lib_destroying_delete should not be defined before c++20" +# endif + +# ifdef __cpp_lib_hardware_interference_size +# error "__cpp_lib_hardware_interference_size should not be defined before c++17" +# endif + +# ifdef __cpp_lib_launder +# error "__cpp_lib_launder should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_constexpr_new +# error "__cpp_lib_constexpr_new should not be defined before c++26" +# endif + +# ifdef __cpp_lib_destroying_delete +# error "__cpp_lib_destroying_delete should not be defined before c++20" +# endif + +# if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)) +# ifndef __cpp_lib_hardware_interference_size +# error "__cpp_lib_hardware_interference_size should be defined in c++17" +# endif +# if __cpp_lib_hardware_interference_size != 201703L +# error "__cpp_lib_hardware_interference_size should have the value 201703L in c++17" +# endif +# else +# ifdef __cpp_lib_hardware_interference_size +# error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!" +# endif +# endif + +# ifndef __cpp_lib_launder +# error "__cpp_lib_launder should be defined in c++17" +# endif +# if __cpp_lib_launder != 201606L +# error "__cpp_lib_launder should have the value 201606L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_constexpr_new +# error "__cpp_lib_constexpr_new should not be defined before c++26" +# endif + +# if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L +# ifndef __cpp_lib_destroying_delete +# error "__cpp_lib_destroying_delete should be defined in c++20" +# endif +# if __cpp_lib_destroying_delete != 201806L +# error "__cpp_lib_destroying_delete should have the value 201806L in c++20" +# endif +# else +# ifdef __cpp_lib_destroying_delete +# error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)) +# ifndef __cpp_lib_hardware_interference_size +# error "__cpp_lib_hardware_interference_size should be defined in c++20" +# endif +# if __cpp_lib_hardware_interference_size != 201703L +# error "__cpp_lib_hardware_interference_size should have the value 201703L in c++20" +# endif +# else +# ifdef __cpp_lib_hardware_interference_size +# error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!" +# endif +# endif + +# ifndef __cpp_lib_launder +# error "__cpp_lib_launder should be defined in c++20" +# endif +# if __cpp_lib_launder != 201606L +# error "__cpp_lib_launder should have the value 201606L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_constexpr_new +# error "__cpp_lib_constexpr_new should not be defined before c++26" +# endif + +# if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L +# ifndef __cpp_lib_destroying_delete +# error "__cpp_lib_destroying_delete should be defined in c++23" +# endif +# if __cpp_lib_destroying_delete != 201806L +# error "__cpp_lib_destroying_delete should have the value 201806L in c++23" +# endif +# else +# ifdef __cpp_lib_destroying_delete +# error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)) +# ifndef __cpp_lib_hardware_interference_size +# error "__cpp_lib_hardware_interference_size should be defined in c++23" +# endif +# if __cpp_lib_hardware_interference_size != 201703L +# error "__cpp_lib_hardware_interference_size should have the value 201703L in c++23" +# endif +# else +# ifdef __cpp_lib_hardware_interference_size +# error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!" +# endif +# endif + +# ifndef __cpp_lib_launder +# error "__cpp_lib_launder should be defined in c++23" +# endif +# if __cpp_lib_launder != 201606L +# error "__cpp_lib_launder should have the value 201606L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_ABI_VCRUNTIME) +# ifndef __cpp_lib_constexpr_new +# error "__cpp_lib_constexpr_new should be defined in c++26" +# endif +# if __cpp_lib_constexpr_new != 202406L +# error "__cpp_lib_constexpr_new should have the value 202406L in c++26" +# endif +# else +# ifdef __cpp_lib_constexpr_new +# error "__cpp_lib_constexpr_new should not be defined when the requirement '!defined(_LIBCPP_ABI_VCRUNTIME)' is not met!" +# endif +# endif + +# if TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L +# ifndef __cpp_lib_destroying_delete +# error "__cpp_lib_destroying_delete should be defined in c++26" +# endif +# if __cpp_lib_destroying_delete != 201806L +# error "__cpp_lib_destroying_delete should have the value 201806L in c++26" +# endif +# else +# ifdef __cpp_lib_destroying_delete +# error "__cpp_lib_destroying_delete should not be defined when the requirement 'TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)) +# ifndef __cpp_lib_hardware_interference_size +# error "__cpp_lib_hardware_interference_size should be defined in c++26" +# endif +# if __cpp_lib_hardware_interference_size != 201703L +# error "__cpp_lib_hardware_interference_size should have the value 201703L in c++26" +# endif +# else +# ifdef __cpp_lib_hardware_interference_size +# error "__cpp_lib_hardware_interference_size should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))' is not met!" +# endif +# endif + +# ifndef __cpp_lib_launder +# error "__cpp_lib_launder should be defined in c++26" +# endif +# if __cpp_lib_launder != 201606L +# error "__cpp_lib_launder should have the value 201606L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/numbers.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/numbers.version.compile.pass.cpp new file mode 100644 index 0000000000000..e8f109610a3e5 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/numbers.version.compile.pass.cpp @@ -0,0 +1,69 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_math_constants +# error "__cpp_lib_math_constants should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_math_constants +# error "__cpp_lib_math_constants should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_math_constants +# error "__cpp_lib_math_constants should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_math_constants +# error "__cpp_lib_math_constants should be defined in c++20" +# endif +# if __cpp_lib_math_constants != 201907L +# error "__cpp_lib_math_constants should have the value 201907L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_math_constants +# error "__cpp_lib_math_constants should be defined in c++23" +# endif +# if __cpp_lib_math_constants != 201907L +# error "__cpp_lib_math_constants should have the value 201907L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_math_constants +# error "__cpp_lib_math_constants should be defined in c++26" +# endif +# if __cpp_lib_math_constants != 201907L +# error "__cpp_lib_math_constants should have the value 201907L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/numeric.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/numeric.version.compile.pass.cpp new file mode 100644 index 0000000000000..687c343e34e08 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/numeric.version.compile.pass.cpp @@ -0,0 +1,255 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_constexpr_numeric +# error "__cpp_lib_constexpr_numeric should not be defined before c++20" +# endif + +# ifdef __cpp_lib_gcd_lcm +# error "__cpp_lib_gcd_lcm should not be defined before c++17" +# endif + +# ifdef __cpp_lib_interpolate +# error "__cpp_lib_interpolate should not be defined before c++20" +# endif + +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined before c++17" +# endif + +# ifdef __cpp_lib_ranges_iota +# error "__cpp_lib_ranges_iota should not be defined before c++23" +# endif + +# ifdef __cpp_lib_saturation_arithmetic +# error "__cpp_lib_saturation_arithmetic should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_constexpr_numeric +# error "__cpp_lib_constexpr_numeric should not be defined before c++20" +# endif + +# ifdef __cpp_lib_gcd_lcm +# error "__cpp_lib_gcd_lcm should not be defined before c++17" +# endif + +# ifdef __cpp_lib_interpolate +# error "__cpp_lib_interpolate should not be defined before c++20" +# endif + +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined before c++17" +# endif + +# ifdef __cpp_lib_ranges_iota +# error "__cpp_lib_ranges_iota should not be defined before c++23" +# endif + +# ifdef __cpp_lib_saturation_arithmetic +# error "__cpp_lib_saturation_arithmetic should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_constexpr_numeric +# error "__cpp_lib_constexpr_numeric should not be defined before c++20" +# endif + +# ifndef __cpp_lib_gcd_lcm +# error "__cpp_lib_gcd_lcm should be defined in c++17" +# endif +# if __cpp_lib_gcd_lcm != 201606L +# error "__cpp_lib_gcd_lcm should have the value 201606L in c++17" +# endif + +# ifdef __cpp_lib_interpolate +# error "__cpp_lib_interpolate should not be defined before c++20" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++17" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++17" +# endif +# else +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifdef __cpp_lib_ranges_iota +# error "__cpp_lib_ranges_iota should not be defined before c++23" +# endif + +# ifdef __cpp_lib_saturation_arithmetic +# error "__cpp_lib_saturation_arithmetic should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_constexpr_numeric +# error "__cpp_lib_constexpr_numeric should be defined in c++20" +# endif +# if __cpp_lib_constexpr_numeric != 201911L +# error "__cpp_lib_constexpr_numeric should have the value 201911L in c++20" +# endif + +# ifndef __cpp_lib_gcd_lcm +# error "__cpp_lib_gcd_lcm should be defined in c++20" +# endif +# if __cpp_lib_gcd_lcm != 201606L +# error "__cpp_lib_gcd_lcm should have the value 201606L in c++20" +# endif + +# ifndef __cpp_lib_interpolate +# error "__cpp_lib_interpolate should be defined in c++20" +# endif +# if __cpp_lib_interpolate != 201902L +# error "__cpp_lib_interpolate should have the value 201902L in c++20" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++20" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++20" +# endif +# else +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifdef __cpp_lib_ranges_iota +# error "__cpp_lib_ranges_iota should not be defined before c++23" +# endif + +# ifdef __cpp_lib_saturation_arithmetic +# error "__cpp_lib_saturation_arithmetic should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_constexpr_numeric +# error "__cpp_lib_constexpr_numeric should be defined in c++23" +# endif +# if __cpp_lib_constexpr_numeric != 201911L +# error "__cpp_lib_constexpr_numeric should have the value 201911L in c++23" +# endif + +# ifndef __cpp_lib_gcd_lcm +# error "__cpp_lib_gcd_lcm should be defined in c++23" +# endif +# if __cpp_lib_gcd_lcm != 201606L +# error "__cpp_lib_gcd_lcm should have the value 201606L in c++23" +# endif + +# ifndef __cpp_lib_interpolate +# error "__cpp_lib_interpolate should be defined in c++23" +# endif +# if __cpp_lib_interpolate != 201902L +# error "__cpp_lib_interpolate should have the value 201902L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++23" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++23" +# endif +# else +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges_iota +# error "__cpp_lib_ranges_iota should be defined in c++23" +# endif +# if __cpp_lib_ranges_iota != 202202L +# error "__cpp_lib_ranges_iota should have the value 202202L in c++23" +# endif + +# ifdef __cpp_lib_saturation_arithmetic +# error "__cpp_lib_saturation_arithmetic should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_constexpr_numeric +# error "__cpp_lib_constexpr_numeric should be defined in c++26" +# endif +# if __cpp_lib_constexpr_numeric != 201911L +# error "__cpp_lib_constexpr_numeric should have the value 201911L in c++26" +# endif + +# ifndef __cpp_lib_gcd_lcm +# error "__cpp_lib_gcd_lcm should be defined in c++26" +# endif +# if __cpp_lib_gcd_lcm != 201606L +# error "__cpp_lib_gcd_lcm should have the value 201606L in c++26" +# endif + +# ifndef __cpp_lib_interpolate +# error "__cpp_lib_interpolate should be defined in c++26" +# endif +# if __cpp_lib_interpolate != 201902L +# error "__cpp_lib_interpolate should have the value 201902L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should be defined in c++26" +# endif +# if __cpp_lib_parallel_algorithm != 201603L +# error "__cpp_lib_parallel_algorithm should have the value 201603L in c++26" +# endif +# else +# ifdef __cpp_lib_parallel_algorithm +# error "__cpp_lib_parallel_algorithm should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges_iota +# error "__cpp_lib_ranges_iota should be defined in c++26" +# endif +# if __cpp_lib_ranges_iota != 202202L +# error "__cpp_lib_ranges_iota should have the value 202202L in c++26" +# endif + +# ifndef __cpp_lib_saturation_arithmetic +# error "__cpp_lib_saturation_arithmetic should be defined in c++26" +# endif +# if __cpp_lib_saturation_arithmetic != 202311L +# error "__cpp_lib_saturation_arithmetic should have the value 202311L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/optional.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/optional.version.compile.pass.cpp new file mode 100644 index 0000000000000..f8ff69f618777 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/optional.version.compile.pass.cpp @@ -0,0 +1,171 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_optional +# error "__cpp_lib_freestanding_optional should not be defined before c++26" +# endif + +# ifdef __cpp_lib_optional +# error "__cpp_lib_optional should not be defined before c++17" +# endif + +# ifdef __cpp_lib_optional_range_support +# error "__cpp_lib_optional_range_support should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_optional +# error "__cpp_lib_freestanding_optional should not be defined before c++26" +# endif + +# ifdef __cpp_lib_optional +# error "__cpp_lib_optional should not be defined before c++17" +# endif + +# ifdef __cpp_lib_optional_range_support +# error "__cpp_lib_optional_range_support should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_optional +# error "__cpp_lib_freestanding_optional should not be defined before c++26" +# endif + +# ifndef __cpp_lib_optional +# error "__cpp_lib_optional should be defined in c++17" +# endif +# if __cpp_lib_optional != 201606L +# error "__cpp_lib_optional should have the value 201606L in c++17" +# endif + +# ifdef __cpp_lib_optional_range_support +# error "__cpp_lib_optional_range_support should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_optional +# error "__cpp_lib_freestanding_optional should not be defined before c++26" +# endif + +# ifndef __cpp_lib_optional +# error "__cpp_lib_optional should be defined in c++20" +# endif +# if __cpp_lib_optional != 202106L +# error "__cpp_lib_optional should have the value 202106L in c++20" +# endif + +# ifdef __cpp_lib_optional_range_support +# error "__cpp_lib_optional_range_support should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_optional +# error "__cpp_lib_freestanding_optional should not be defined before c++26" +# endif + +# ifndef __cpp_lib_optional +# error "__cpp_lib_optional should be defined in c++23" +# endif +# if __cpp_lib_optional != 202110L +# error "__cpp_lib_optional should have the value 202110L in c++23" +# endif + +# ifdef __cpp_lib_optional_range_support +# error "__cpp_lib_optional_range_support should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should be defined in c++26" +# endif +# if __cpp_lib_constrained_equality != 202403L +# error "__cpp_lib_constrained_equality should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_freestanding_optional +# error "__cpp_lib_freestanding_optional should be defined in c++26" +# endif +# if __cpp_lib_freestanding_optional != 202311L +# error "__cpp_lib_freestanding_optional should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_freestanding_optional +# error "__cpp_lib_freestanding_optional should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_optional +# error "__cpp_lib_optional should be defined in c++26" +# endif +# if __cpp_lib_optional != 202110L +# error "__cpp_lib_optional should have the value 202110L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_optional_range_support +# error "__cpp_lib_optional_range_support should be defined in c++26" +# endif +# if __cpp_lib_optional_range_support != 202406L +# error "__cpp_lib_optional_range_support should have the value 202406L in c++26" +# endif +# else +# ifdef __cpp_lib_optional_range_support +# error "__cpp_lib_optional_range_support should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/ostream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/ostream.version.compile.pass.cpp new file mode 100644 index 0000000000000..de0520af18e2a --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/ostream.version.compile.pass.cpp @@ -0,0 +1,131 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-localization + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +# ifdef __cpp_lib_print +# error "__cpp_lib_print should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +# ifdef __cpp_lib_print +# error "__cpp_lib_print should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +# ifdef __cpp_lib_print +# error "__cpp_lib_print should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++20" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +# ifdef __cpp_lib_print +# error "__cpp_lib_print should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++23" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT +# ifndef __cpp_lib_print +# error "__cpp_lib_print should be defined in c++23" +# endif +# if __cpp_lib_print != 202207L +# error "__cpp_lib_print should have the value 202207L in c++23" +# endif +# else +# ifdef __cpp_lib_print +# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++26" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT +# ifndef __cpp_lib_print +# error "__cpp_lib_print should be defined in c++26" +# endif +# if __cpp_lib_print != 202207L +# error "__cpp_lib_print should have the value 202207L in c++26" +# endif +# else +# ifdef __cpp_lib_print +# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/print.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/print.version.compile.pass.cpp new file mode 100644 index 0000000000000..263d20ace2fd9 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/print.version.compile.pass.cpp @@ -0,0 +1,80 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-filesystem + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_print +# error "__cpp_lib_print should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_print +# error "__cpp_lib_print should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_print +# error "__cpp_lib_print should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_print +# error "__cpp_lib_print should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT +# ifndef __cpp_lib_print +# error "__cpp_lib_print should be defined in c++23" +# endif +# if __cpp_lib_print != 202207L +# error "__cpp_lib_print should have the value 202207L in c++23" +# endif +# else +# ifdef __cpp_lib_print +# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT +# ifndef __cpp_lib_print +# error "__cpp_lib_print should be defined in c++26" +# endif +# if __cpp_lib_print != 202207L +# error "__cpp_lib_print should have the value 202207L in c++26" +# endif +# else +# ifdef __cpp_lib_print +# error "__cpp_lib_print should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/queue.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/queue.version.compile.pass.cpp new file mode 100644 index 0000000000000..6aff89ae3f95a --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/queue.version.compile.pass.cpp @@ -0,0 +1,96 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_adaptor_iterator_pair_constructor +# error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_adaptor_iterator_pair_constructor +# error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_adaptor_iterator_pair_constructor +# error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_adaptor_iterator_pair_constructor +# error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_adaptor_iterator_pair_constructor +# error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++23" +# endif +# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L +# error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++23" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++23" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_adaptor_iterator_pair_constructor +# error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++26" +# endif +# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L +# error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++26" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++26" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/random.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/random.version.compile.pass.cpp new file mode 100644 index 0000000000000..17283bd362e46 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/random.version.compile.pass.cpp @@ -0,0 +1,104 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_generate_random +# error "__cpp_lib_generate_random should not be defined before c++26" +# endif + +# ifdef __cpp_lib_philox_engine +# error "__cpp_lib_philox_engine should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_generate_random +# error "__cpp_lib_generate_random should not be defined before c++26" +# endif + +# ifdef __cpp_lib_philox_engine +# error "__cpp_lib_philox_engine should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_generate_random +# error "__cpp_lib_generate_random should not be defined before c++26" +# endif + +# ifdef __cpp_lib_philox_engine +# error "__cpp_lib_philox_engine should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_generate_random +# error "__cpp_lib_generate_random should not be defined before c++26" +# endif + +# ifdef __cpp_lib_philox_engine +# error "__cpp_lib_philox_engine should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_generate_random +# error "__cpp_lib_generate_random should not be defined before c++26" +# endif + +# ifdef __cpp_lib_philox_engine +# error "__cpp_lib_philox_engine should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_generate_random +# error "__cpp_lib_generate_random should be defined in c++26" +# endif +# if __cpp_lib_generate_random != 202403L +# error "__cpp_lib_generate_random should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_generate_random +# error "__cpp_lib_generate_random should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_philox_engine +# error "__cpp_lib_philox_engine should be defined in c++26" +# endif +# if __cpp_lib_philox_engine != 202406L +# error "__cpp_lib_philox_engine should have the value 202406L in c++26" +# endif +# else +# ifdef __cpp_lib_philox_engine +# error "__cpp_lib_philox_engine should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/ranges.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/ranges.version.compile.pass.cpp new file mode 100644 index 0000000000000..c7c8112e123cd --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/ranges.version.compile.pass.cpp @@ -0,0 +1,465 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_ranges_as_const +# error "__cpp_lib_ranges_as_const should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_as_rvalue +# error "__cpp_lib_ranges_as_rvalue should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_chunk +# error "__cpp_lib_ranges_chunk should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_chunk_by +# error "__cpp_lib_ranges_chunk_by should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_concat +# error "__cpp_lib_ranges_concat should not be defined before c++26" +# endif + +# ifdef __cpp_lib_ranges_join_with +# error "__cpp_lib_ranges_join_with should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_repeat +# error "__cpp_lib_ranges_repeat should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_slide +# error "__cpp_lib_ranges_slide should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_to_container +# error "__cpp_lib_ranges_to_container should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_ranges_as_const +# error "__cpp_lib_ranges_as_const should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_as_rvalue +# error "__cpp_lib_ranges_as_rvalue should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_chunk +# error "__cpp_lib_ranges_chunk should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_chunk_by +# error "__cpp_lib_ranges_chunk_by should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_concat +# error "__cpp_lib_ranges_concat should not be defined before c++26" +# endif + +# ifdef __cpp_lib_ranges_join_with +# error "__cpp_lib_ranges_join_with should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_repeat +# error "__cpp_lib_ranges_repeat should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_slide +# error "__cpp_lib_ranges_slide should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_to_container +# error "__cpp_lib_ranges_to_container should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_ranges +# error "__cpp_lib_ranges should not be defined before c++20" +# endif + +# ifdef __cpp_lib_ranges_as_const +# error "__cpp_lib_ranges_as_const should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_as_rvalue +# error "__cpp_lib_ranges_as_rvalue should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_chunk +# error "__cpp_lib_ranges_chunk should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_chunk_by +# error "__cpp_lib_ranges_chunk_by should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_concat +# error "__cpp_lib_ranges_concat should not be defined before c++26" +# endif + +# ifdef __cpp_lib_ranges_join_with +# error "__cpp_lib_ranges_join_with should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_repeat +# error "__cpp_lib_ranges_repeat should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_slide +# error "__cpp_lib_ranges_slide should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_to_container +# error "__cpp_lib_ranges_to_container should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++20" +# endif +# if __cpp_lib_ranges != 202110L +# error "__cpp_lib_ranges should have the value 202110L in c++20" +# endif + +# ifdef __cpp_lib_ranges_as_const +# error "__cpp_lib_ranges_as_const should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_as_rvalue +# error "__cpp_lib_ranges_as_rvalue should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_chunk +# error "__cpp_lib_ranges_chunk should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_chunk_by +# error "__cpp_lib_ranges_chunk_by should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_concat +# error "__cpp_lib_ranges_concat should not be defined before c++26" +# endif + +# ifdef __cpp_lib_ranges_join_with +# error "__cpp_lib_ranges_join_with should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_repeat +# error "__cpp_lib_ranges_repeat should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_slide +# error "__cpp_lib_ranges_slide should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_to_container +# error "__cpp_lib_ranges_to_container should not be defined before c++23" +# endif + +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++23" +# endif +# if __cpp_lib_ranges != 202406L +# error "__cpp_lib_ranges should have the value 202406L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_as_const +# error "__cpp_lib_ranges_as_const should be defined in c++23" +# endif +# if __cpp_lib_ranges_as_const != 202207L +# error "__cpp_lib_ranges_as_const should have the value 202207L in c++23" +# endif +# else +# ifdef __cpp_lib_ranges_as_const +# error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges_as_rvalue +# error "__cpp_lib_ranges_as_rvalue should be defined in c++23" +# endif +# if __cpp_lib_ranges_as_rvalue != 202207L +# error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_chunk +# error "__cpp_lib_ranges_chunk should be defined in c++23" +# endif +# if __cpp_lib_ranges_chunk != 202202L +# error "__cpp_lib_ranges_chunk should have the value 202202L in c++23" +# endif +# else +# ifdef __cpp_lib_ranges_chunk +# error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges_chunk_by +# error "__cpp_lib_ranges_chunk_by should be defined in c++23" +# endif +# if __cpp_lib_ranges_chunk_by != 202202L +# error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++23" +# endif + +# ifdef __cpp_lib_ranges_concat +# error "__cpp_lib_ranges_concat should not be defined before c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_join_with +# error "__cpp_lib_ranges_join_with should be defined in c++23" +# endif +# if __cpp_lib_ranges_join_with != 202202L +# error "__cpp_lib_ranges_join_with should have the value 202202L in c++23" +# endif +# else +# ifdef __cpp_lib_ranges_join_with +# error "__cpp_lib_ranges_join_with should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges_repeat +# error "__cpp_lib_ranges_repeat should be defined in c++23" +# endif +# if __cpp_lib_ranges_repeat != 202207L +# error "__cpp_lib_ranges_repeat should have the value 202207L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_slide +# error "__cpp_lib_ranges_slide should be defined in c++23" +# endif +# if __cpp_lib_ranges_slide != 202202L +# error "__cpp_lib_ranges_slide should have the value 202202L in c++23" +# endif +# else +# ifdef __cpp_lib_ranges_slide +# error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges_to_container +# error "__cpp_lib_ranges_to_container should be defined in c++23" +# endif +# if __cpp_lib_ranges_to_container != 202202L +# error "__cpp_lib_ranges_to_container should have the value 202202L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should be defined in c++23" +# endif +# if __cpp_lib_ranges_zip != 202110L +# error "__cpp_lib_ranges_zip should have the value 202110L in c++23" +# endif +# else +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26" +# endif +# if __cpp_lib_default_template_type_for_algorithm_values != 202403L +# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges +# error "__cpp_lib_ranges should be defined in c++26" +# endif +# if __cpp_lib_ranges != 202406L +# error "__cpp_lib_ranges should have the value 202406L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_as_const +# error "__cpp_lib_ranges_as_const should be defined in c++26" +# endif +# if __cpp_lib_ranges_as_const != 202207L +# error "__cpp_lib_ranges_as_const should have the value 202207L in c++26" +# endif +# else +# ifdef __cpp_lib_ranges_as_const +# error "__cpp_lib_ranges_as_const should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges_as_rvalue +# error "__cpp_lib_ranges_as_rvalue should be defined in c++26" +# endif +# if __cpp_lib_ranges_as_rvalue != 202207L +# error "__cpp_lib_ranges_as_rvalue should have the value 202207L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_chunk +# error "__cpp_lib_ranges_chunk should be defined in c++26" +# endif +# if __cpp_lib_ranges_chunk != 202202L +# error "__cpp_lib_ranges_chunk should have the value 202202L in c++26" +# endif +# else +# ifdef __cpp_lib_ranges_chunk +# error "__cpp_lib_ranges_chunk should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges_chunk_by +# error "__cpp_lib_ranges_chunk_by should be defined in c++26" +# endif +# if __cpp_lib_ranges_chunk_by != 202202L +# error "__cpp_lib_ranges_chunk_by should have the value 202202L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_concat +# error "__cpp_lib_ranges_concat should be defined in c++26" +# endif +# if __cpp_lib_ranges_concat != 202403L +# error "__cpp_lib_ranges_concat should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_ranges_concat +# error "__cpp_lib_ranges_concat should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_join_with +# error "__cpp_lib_ranges_join_with should be defined in c++26" +# endif +# if __cpp_lib_ranges_join_with != 202202L +# error "__cpp_lib_ranges_join_with should have the value 202202L in c++26" +# endif +# else +# ifdef __cpp_lib_ranges_join_with +# error "__cpp_lib_ranges_join_with should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges_repeat +# error "__cpp_lib_ranges_repeat should be defined in c++26" +# endif +# if __cpp_lib_ranges_repeat != 202207L +# error "__cpp_lib_ranges_repeat should have the value 202207L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_slide +# error "__cpp_lib_ranges_slide should be defined in c++26" +# endif +# if __cpp_lib_ranges_slide != 202202L +# error "__cpp_lib_ranges_slide should have the value 202202L in c++26" +# endif +# else +# ifdef __cpp_lib_ranges_slide +# error "__cpp_lib_ranges_slide should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_ranges_to_container +# error "__cpp_lib_ranges_to_container should be defined in c++26" +# endif +# if __cpp_lib_ranges_to_container != 202202L +# error "__cpp_lib_ranges_to_container should have the value 202202L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should be defined in c++26" +# endif +# if __cpp_lib_ranges_zip != 202110L +# error "__cpp_lib_ranges_zip should have the value 202110L in c++26" +# endif +# else +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/ratio.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/ratio.version.compile.pass.cpp new file mode 100644 index 0000000000000..6507e1c683f24 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/ratio.version.compile.pass.cpp @@ -0,0 +1,63 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_ratio +# error "__cpp_lib_ratio should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_ratio +# error "__cpp_lib_ratio should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_ratio +# error "__cpp_lib_ratio should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_ratio +# error "__cpp_lib_ratio should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_ratio +# error "__cpp_lib_ratio should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_ratio +# error "__cpp_lib_ratio should be defined in c++26" +# endif +# if __cpp_lib_ratio != 202306L +# error "__cpp_lib_ratio should have the value 202306L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/rcu.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/rcu.version.compile.pass.cpp new file mode 100644 index 0000000000000..20caf83864a10 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/rcu.version.compile.pass.cpp @@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_rcu +# error "__cpp_lib_rcu should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_rcu +# error "__cpp_lib_rcu should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_rcu +# error "__cpp_lib_rcu should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_rcu +# error "__cpp_lib_rcu should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_rcu +# error "__cpp_lib_rcu should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_rcu +# error "__cpp_lib_rcu should be defined in c++26" +# endif +# if __cpp_lib_rcu != 202306L +# error "__cpp_lib_rcu should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_rcu +# error "__cpp_lib_rcu should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/regex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/regex.version.compile.pass.cpp new file mode 100644 index 0000000000000..d6acf35d63ab0 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/regex.version.compile.pass.cpp @@ -0,0 +1,74 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-localization + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++17" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++20" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++23" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++26" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/scoped_allocator.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/scoped_allocator.version.compile.pass.cpp new file mode 100644 index 0000000000000..4246f2515dc09 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/scoped_allocator.version.compile.pass.cpp @@ -0,0 +1,72 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/semaphore.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/semaphore.version.compile.pass.cpp new file mode 100644 index 0000000000000..fd0f0c51e72b2 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/semaphore.version.compile.pass.cpp @@ -0,0 +1,89 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-threads + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_semaphore +# error "__cpp_lib_semaphore should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_semaphore +# error "__cpp_lib_semaphore should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_semaphore +# error "__cpp_lib_semaphore should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_semaphore +# error "__cpp_lib_semaphore should be defined in c++20" +# endif +# if __cpp_lib_semaphore != 201907L +# error "__cpp_lib_semaphore should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_semaphore +# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_semaphore +# error "__cpp_lib_semaphore should be defined in c++23" +# endif +# if __cpp_lib_semaphore != 201907L +# error "__cpp_lib_semaphore should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_semaphore +# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_semaphore +# error "__cpp_lib_semaphore should be defined in c++26" +# endif +# if __cpp_lib_semaphore != 201907L +# error "__cpp_lib_semaphore should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_semaphore +# error "__cpp_lib_semaphore should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/set.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/set.version.compile.pass.cpp new file mode 100644 index 0000000000000..80eae6e1fd274 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/set.version.compile.pass.cpp @@ -0,0 +1,321 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_generic_associative_lookup +# error "__cpp_lib_generic_associative_lookup should not be defined before c++14" +# endif + +# ifdef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should not be defined before c++17" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifndef __cpp_lib_generic_associative_lookup +# error "__cpp_lib_generic_associative_lookup should be defined in c++14" +# endif +# if __cpp_lib_generic_associative_lookup != 201304L +# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14" +# endif + +# ifdef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should not be defined before c++17" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifndef __cpp_lib_generic_associative_lookup +# error "__cpp_lib_generic_associative_lookup should be defined in c++17" +# endif +# if __cpp_lib_generic_associative_lookup != 201304L +# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++17" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++17" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++17" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++20" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++20" +# endif + +# ifndef __cpp_lib_generic_associative_lookup +# error "__cpp_lib_generic_associative_lookup should be defined in c++20" +# endif +# if __cpp_lib_generic_associative_lookup != 201304L +# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++20" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++20" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++20" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23" +# endif +# if __cpp_lib_associative_heterogeneous_erasure != 202110L +# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23" +# endif +# else +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++23" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++23" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++23" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++23" +# endif + +# ifndef __cpp_lib_generic_associative_lookup +# error "__cpp_lib_generic_associative_lookup should be defined in c++23" +# endif +# if __cpp_lib_generic_associative_lookup != 201304L +# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++23" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++23" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++23" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++23" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26" +# endif +# if __cpp_lib_associative_heterogeneous_erasure != 202110L +# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26" +# endif +# else +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26" +# endif +# if __cpp_lib_associative_heterogeneous_insertion != 202306L +# error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++26" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++26" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++26" +# endif + +# ifndef __cpp_lib_generic_associative_lookup +# error "__cpp_lib_generic_associative_lookup should be defined in c++26" +# endif +# if __cpp_lib_generic_associative_lookup != 201304L +# error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++26" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++26" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++26" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/shared_mutex.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/shared_mutex.version.compile.pass.cpp new file mode 100644 index 0000000000000..4392173ebbb3a --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/shared_mutex.version.compile.pass.cpp @@ -0,0 +1,167 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-threads + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_shared_mutex +# error "__cpp_lib_shared_mutex should not be defined before c++17" +# endif + +# ifdef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex should not be defined before c++14" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_shared_mutex +# error "__cpp_lib_shared_mutex should not be defined before c++17" +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex should be defined in c++14" +# endif +# if __cpp_lib_shared_timed_mutex != 201402L +# error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++14" +# endif +# else +# ifdef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 17 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_shared_mutex +# error "__cpp_lib_shared_mutex should be defined in c++17" +# endif +# if __cpp_lib_shared_mutex != 201505L +# error "__cpp_lib_shared_mutex should have the value 201505L in c++17" +# endif +# else +# ifdef __cpp_lib_shared_mutex +# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex should be defined in c++17" +# endif +# if __cpp_lib_shared_timed_mutex != 201402L +# error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++17" +# endif +# else +# ifdef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_shared_mutex +# error "__cpp_lib_shared_mutex should be defined in c++20" +# endif +# if __cpp_lib_shared_mutex != 201505L +# error "__cpp_lib_shared_mutex should have the value 201505L in c++20" +# endif +# else +# ifdef __cpp_lib_shared_mutex +# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex should be defined in c++20" +# endif +# if __cpp_lib_shared_timed_mutex != 201402L +# error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++20" +# endif +# else +# ifdef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_shared_mutex +# error "__cpp_lib_shared_mutex should be defined in c++23" +# endif +# if __cpp_lib_shared_mutex != 201505L +# error "__cpp_lib_shared_mutex should have the value 201505L in c++23" +# endif +# else +# ifdef __cpp_lib_shared_mutex +# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex should be defined in c++23" +# endif +# if __cpp_lib_shared_timed_mutex != 201402L +# error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++23" +# endif +# else +# ifdef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_shared_mutex +# error "__cpp_lib_shared_mutex should be defined in c++26" +# endif +# if __cpp_lib_shared_mutex != 201505L +# error "__cpp_lib_shared_mutex should have the value 201505L in c++26" +# endif +# else +# ifdef __cpp_lib_shared_mutex +# error "__cpp_lib_shared_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS +# ifndef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex should be defined in c++26" +# endif +# if __cpp_lib_shared_timed_mutex != 201402L +# error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++26" +# endif +# else +# ifdef __cpp_lib_shared_timed_mutex +# error "__cpp_lib_shared_timed_mutex should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/source_location.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/source_location.version.compile.pass.cpp new file mode 100644 index 0000000000000..2b326e2b37832 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/source_location.version.compile.pass.cpp @@ -0,0 +1,69 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_source_location +# error "__cpp_lib_source_location should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_source_location +# error "__cpp_lib_source_location should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_source_location +# error "__cpp_lib_source_location should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_source_location +# error "__cpp_lib_source_location should be defined in c++20" +# endif +# if __cpp_lib_source_location != 201907L +# error "__cpp_lib_source_location should have the value 201907L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_source_location +# error "__cpp_lib_source_location should be defined in c++23" +# endif +# if __cpp_lib_source_location != 201907L +# error "__cpp_lib_source_location should have the value 201907L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_source_location +# error "__cpp_lib_source_location should be defined in c++26" +# endif +# if __cpp_lib_source_location != 201907L +# error "__cpp_lib_source_location should have the value 201907L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/span.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/span.version.compile.pass.cpp new file mode 100644 index 0000000000000..3c550e0fa676e --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/span.version.compile.pass.cpp @@ -0,0 +1,123 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_span +# error "__cpp_lib_span should not be defined before c++20" +# endif + +# ifdef __cpp_lib_span_at +# error "__cpp_lib_span_at should not be defined before c++26" +# endif + +# ifdef __cpp_lib_span_initializer_list +# error "__cpp_lib_span_initializer_list should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_span +# error "__cpp_lib_span should not be defined before c++20" +# endif + +# ifdef __cpp_lib_span_at +# error "__cpp_lib_span_at should not be defined before c++26" +# endif + +# ifdef __cpp_lib_span_initializer_list +# error "__cpp_lib_span_initializer_list should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_span +# error "__cpp_lib_span should not be defined before c++20" +# endif + +# ifdef __cpp_lib_span_at +# error "__cpp_lib_span_at should not be defined before c++26" +# endif + +# ifdef __cpp_lib_span_initializer_list +# error "__cpp_lib_span_initializer_list should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_span +# error "__cpp_lib_span should be defined in c++20" +# endif +# if __cpp_lib_span != 202002L +# error "__cpp_lib_span should have the value 202002L in c++20" +# endif + +# ifdef __cpp_lib_span_at +# error "__cpp_lib_span_at should not be defined before c++26" +# endif + +# ifdef __cpp_lib_span_initializer_list +# error "__cpp_lib_span_initializer_list should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_span +# error "__cpp_lib_span should be defined in c++23" +# endif +# if __cpp_lib_span != 202002L +# error "__cpp_lib_span should have the value 202002L in c++23" +# endif + +# ifdef __cpp_lib_span_at +# error "__cpp_lib_span_at should not be defined before c++26" +# endif + +# ifdef __cpp_lib_span_initializer_list +# error "__cpp_lib_span_initializer_list should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_span +# error "__cpp_lib_span should be defined in c++26" +# endif +# if __cpp_lib_span != 202002L +# error "__cpp_lib_span should have the value 202002L in c++26" +# endif + +# ifndef __cpp_lib_span_at +# error "__cpp_lib_span_at should be defined in c++26" +# endif +# if __cpp_lib_span_at != 202311L +# error "__cpp_lib_span_at should have the value 202311L in c++26" +# endif + +# ifndef __cpp_lib_span_initializer_list +# error "__cpp_lib_span_initializer_list should be defined in c++26" +# endif +# if __cpp_lib_span_initializer_list != 202311L +# error "__cpp_lib_span_initializer_list should have the value 202311L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/spanstream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/spanstream.version.compile.pass.cpp new file mode 100644 index 0000000000000..16611e1317e12 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/spanstream.version.compile.pass.cpp @@ -0,0 +1,80 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_spanstream +# error "__cpp_lib_spanstream should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_spanstream +# error "__cpp_lib_spanstream should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_spanstream +# error "__cpp_lib_spanstream should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_spanstream +# error "__cpp_lib_spanstream should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_spanstream +# error "__cpp_lib_spanstream should be defined in c++23" +# endif +# if __cpp_lib_spanstream != 202106L +# error "__cpp_lib_spanstream should have the value 202106L in c++23" +# endif +# else +# ifdef __cpp_lib_spanstream +# error "__cpp_lib_spanstream should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_spanstream +# error "__cpp_lib_spanstream should be defined in c++26" +# endif +# if __cpp_lib_spanstream != 202106L +# error "__cpp_lib_spanstream should have the value 202106L in c++26" +# endif +# else +# ifdef __cpp_lib_spanstream +# error "__cpp_lib_spanstream should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/sstream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/sstream.version.compile.pass.cpp new file mode 100644 index 0000000000000..b7650c436128e --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/sstream.version.compile.pass.cpp @@ -0,0 +1,65 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-localization + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_sstream_from_string_view +# error "__cpp_lib_sstream_from_string_view should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_sstream_from_string_view +# error "__cpp_lib_sstream_from_string_view should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_sstream_from_string_view +# error "__cpp_lib_sstream_from_string_view should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_sstream_from_string_view +# error "__cpp_lib_sstream_from_string_view should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_sstream_from_string_view +# error "__cpp_lib_sstream_from_string_view should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_sstream_from_string_view +# error "__cpp_lib_sstream_from_string_view should be defined in c++26" +# endif +# if __cpp_lib_sstream_from_string_view != 202306L +# error "__cpp_lib_sstream_from_string_view should have the value 202306L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/stack.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/stack.version.compile.pass.cpp new file mode 100644 index 0000000000000..1e530ccc3043d --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/stack.version.compile.pass.cpp @@ -0,0 +1,96 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_adaptor_iterator_pair_constructor +# error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_adaptor_iterator_pair_constructor +# error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_adaptor_iterator_pair_constructor +# error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_adaptor_iterator_pair_constructor +# error "__cpp_lib_adaptor_iterator_pair_constructor should not be defined before c++23" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_adaptor_iterator_pair_constructor +# error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++23" +# endif +# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L +# error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++23" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++23" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_adaptor_iterator_pair_constructor +# error "__cpp_lib_adaptor_iterator_pair_constructor should be defined in c++26" +# endif +# if __cpp_lib_adaptor_iterator_pair_constructor != 202106L +# error "__cpp_lib_adaptor_iterator_pair_constructor should have the value 202106L in c++26" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++26" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/stacktrace.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/stacktrace.version.compile.pass.cpp new file mode 100644 index 0000000000000..2d686546c9528 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/stacktrace.version.compile.pass.cpp @@ -0,0 +1,122 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_formatters +# error "__cpp_lib_formatters should not be defined before c++23" +# endif + +# ifdef __cpp_lib_stacktrace +# error "__cpp_lib_stacktrace should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_formatters +# error "__cpp_lib_formatters should not be defined before c++23" +# endif + +# ifdef __cpp_lib_stacktrace +# error "__cpp_lib_stacktrace should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_formatters +# error "__cpp_lib_formatters should not be defined before c++23" +# endif + +# ifdef __cpp_lib_stacktrace +# error "__cpp_lib_stacktrace should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_formatters +# error "__cpp_lib_formatters should not be defined before c++23" +# endif + +# ifdef __cpp_lib_stacktrace +# error "__cpp_lib_stacktrace should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_formatters +# error "__cpp_lib_formatters should be defined in c++23" +# endif +# if __cpp_lib_formatters != 202302L +# error "__cpp_lib_formatters should have the value 202302L in c++23" +# endif +# else +# ifdef __cpp_lib_formatters +# error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_stacktrace +# error "__cpp_lib_stacktrace should be defined in c++23" +# endif +# if __cpp_lib_stacktrace != 202011L +# error "__cpp_lib_stacktrace should have the value 202011L in c++23" +# endif +# else +# ifdef __cpp_lib_stacktrace +# error "__cpp_lib_stacktrace should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_formatters +# error "__cpp_lib_formatters should be defined in c++26" +# endif +# if __cpp_lib_formatters != 202302L +# error "__cpp_lib_formatters should have the value 202302L in c++26" +# endif +# else +# ifdef __cpp_lib_formatters +# error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_stacktrace +# error "__cpp_lib_stacktrace should be defined in c++26" +# endif +# if __cpp_lib_stacktrace != 202011L +# error "__cpp_lib_stacktrace should have the value 202011L in c++26" +# endif +# else +# ifdef __cpp_lib_stacktrace +# error "__cpp_lib_stacktrace should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/stdatomic.h.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/stdatomic.h.version.compile.pass.cpp new file mode 100644 index 0000000000000..113ffce2a5d12 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/stdatomic.h.version.compile.pass.cpp @@ -0,0 +1,68 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-threads + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_stdatomic_h +# error "__cpp_lib_stdatomic_h should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_stdatomic_h +# error "__cpp_lib_stdatomic_h should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_stdatomic_h +# error "__cpp_lib_stdatomic_h should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_stdatomic_h +# error "__cpp_lib_stdatomic_h should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_stdatomic_h +# error "__cpp_lib_stdatomic_h should be defined in c++23" +# endif +# if __cpp_lib_stdatomic_h != 202011L +# error "__cpp_lib_stdatomic_h should have the value 202011L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_stdatomic_h +# error "__cpp_lib_stdatomic_h should be defined in c++26" +# endif +# if __cpp_lib_stdatomic_h != 202011L +# error "__cpp_lib_stdatomic_h should have the value 202011L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/stop_token.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/stop_token.version.compile.pass.cpp new file mode 100644 index 0000000000000..ac70b0c21e018 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/stop_token.version.compile.pass.cpp @@ -0,0 +1,89 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-threads + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_jthread +# error "__cpp_lib_jthread should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_jthread +# error "__cpp_lib_jthread should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_jthread +# error "__cpp_lib_jthread should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_jthread +# error "__cpp_lib_jthread should be defined in c++20" +# endif +# if __cpp_lib_jthread != 201911L +# error "__cpp_lib_jthread should have the value 201911L in c++20" +# endif +# else +# ifdef __cpp_lib_jthread +# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_jthread +# error "__cpp_lib_jthread should be defined in c++23" +# endif +# if __cpp_lib_jthread != 201911L +# error "__cpp_lib_jthread should have the value 201911L in c++23" +# endif +# else +# ifdef __cpp_lib_jthread +# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_jthread +# error "__cpp_lib_jthread should be defined in c++26" +# endif +# if __cpp_lib_jthread != 201911L +# error "__cpp_lib_jthread should have the value 201911L in c++26" +# endif +# else +# ifdef __cpp_lib_jthread +# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/string.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/string.version.compile.pass.cpp new file mode 100644 index 0000000000000..40a6c07081008 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/string.version.compile.pass.cpp @@ -0,0 +1,489 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_string +# error "__cpp_lib_constexpr_string should not be defined before c++20" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++20" +# endif + +# ifdef __cpp_lib_string_contains +# error "__cpp_lib_string_contains should not be defined before c++23" +# endif + +# ifdef __cpp_lib_string_resize_and_overwrite +# error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23" +# endif + +# ifdef __cpp_lib_string_udls +# error "__cpp_lib_string_udls should not be defined before c++14" +# endif + +# ifdef __cpp_lib_string_view +# error "__cpp_lib_string_view should not be defined before c++17" +# endif + +# ifdef __cpp_lib_to_string +# error "__cpp_lib_to_string should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_string +# error "__cpp_lib_constexpr_string should not be defined before c++20" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++20" +# endif + +# ifdef __cpp_lib_string_contains +# error "__cpp_lib_string_contains should not be defined before c++23" +# endif + +# ifdef __cpp_lib_string_resize_and_overwrite +# error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23" +# endif + +# ifndef __cpp_lib_string_udls +# error "__cpp_lib_string_udls should be defined in c++14" +# endif +# if __cpp_lib_string_udls != 201304L +# error "__cpp_lib_string_udls should have the value 201304L in c++14" +# endif + +# ifdef __cpp_lib_string_view +# error "__cpp_lib_string_view should not be defined before c++17" +# endif + +# ifdef __cpp_lib_to_string +# error "__cpp_lib_to_string should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_string +# error "__cpp_lib_constexpr_string should not be defined before c++20" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++17" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++20" +# endif + +# ifdef __cpp_lib_string_contains +# error "__cpp_lib_string_contains should not be defined before c++23" +# endif + +# ifdef __cpp_lib_string_resize_and_overwrite +# error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23" +# endif + +# ifndef __cpp_lib_string_udls +# error "__cpp_lib_string_udls should be defined in c++17" +# endif +# if __cpp_lib_string_udls != 201304L +# error "__cpp_lib_string_udls should have the value 201304L in c++17" +# endif + +# ifndef __cpp_lib_string_view +# error "__cpp_lib_string_view should be defined in c++17" +# endif +# if __cpp_lib_string_view != 201606L +# error "__cpp_lib_string_view should have the value 201606L in c++17" +# endif + +# ifdef __cpp_lib_to_string +# error "__cpp_lib_to_string should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" +# endif + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++20" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +# ifndef __cpp_lib_constexpr_string +# error "__cpp_lib_constexpr_string should be defined in c++20" +# endif +# if __cpp_lib_constexpr_string != 201907L +# error "__cpp_lib_constexpr_string should have the value 201907L in c++20" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++20" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++20" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" +# endif + +# ifndef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should be defined in c++20" +# endif +# if __cpp_lib_starts_ends_with != 201711L +# error "__cpp_lib_starts_ends_with should have the value 201711L in c++20" +# endif + +# ifdef __cpp_lib_string_contains +# error "__cpp_lib_string_contains should not be defined before c++23" +# endif + +# ifdef __cpp_lib_string_resize_and_overwrite +# error "__cpp_lib_string_resize_and_overwrite should not be defined before c++23" +# endif + +# ifndef __cpp_lib_string_udls +# error "__cpp_lib_string_udls should be defined in c++20" +# endif +# if __cpp_lib_string_udls != 201304L +# error "__cpp_lib_string_udls should have the value 201304L in c++20" +# endif + +# ifndef __cpp_lib_string_view +# error "__cpp_lib_string_view should be defined in c++20" +# endif +# if __cpp_lib_string_view != 201803L +# error "__cpp_lib_string_view should have the value 201803L in c++20" +# endif + +# ifdef __cpp_lib_to_string +# error "__cpp_lib_to_string should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" +# endif + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++23" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +# ifndef __cpp_lib_constexpr_string +# error "__cpp_lib_constexpr_string should be defined in c++23" +# endif +# if __cpp_lib_constexpr_string != 201907L +# error "__cpp_lib_constexpr_string should have the value 201907L in c++23" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++23" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++23" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++23" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++23" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" +# endif + +# ifndef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should be defined in c++23" +# endif +# if __cpp_lib_starts_ends_with != 201711L +# error "__cpp_lib_starts_ends_with should have the value 201711L in c++23" +# endif + +# ifndef __cpp_lib_string_contains +# error "__cpp_lib_string_contains should be defined in c++23" +# endif +# if __cpp_lib_string_contains != 202011L +# error "__cpp_lib_string_contains should have the value 202011L in c++23" +# endif + +# ifndef __cpp_lib_string_resize_and_overwrite +# error "__cpp_lib_string_resize_and_overwrite should be defined in c++23" +# endif +# if __cpp_lib_string_resize_and_overwrite != 202110L +# error "__cpp_lib_string_resize_and_overwrite should have the value 202110L in c++23" +# endif + +# ifndef __cpp_lib_string_udls +# error "__cpp_lib_string_udls should be defined in c++23" +# endif +# if __cpp_lib_string_udls != 201304L +# error "__cpp_lib_string_udls should have the value 201304L in c++23" +# endif + +# ifndef __cpp_lib_string_view +# error "__cpp_lib_string_view should be defined in c++23" +# endif +# if __cpp_lib_string_view != 201803L +# error "__cpp_lib_string_view should have the value 201803L in c++23" +# endif + +# ifdef __cpp_lib_to_string +# error "__cpp_lib_to_string should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" +# endif + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++26" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +# ifndef __cpp_lib_constexpr_string +# error "__cpp_lib_constexpr_string should be defined in c++26" +# endif +# if __cpp_lib_constexpr_string != 201907L +# error "__cpp_lib_constexpr_string should have the value 201907L in c++26" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++26" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26" +# endif +# if __cpp_lib_default_template_type_for_algorithm_values != 202403L +# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++26" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++26" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" +# endif + +# ifndef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should be defined in c++26" +# endif +# if __cpp_lib_starts_ends_with != 201711L +# error "__cpp_lib_starts_ends_with should have the value 201711L in c++26" +# endif + +# ifndef __cpp_lib_string_contains +# error "__cpp_lib_string_contains should be defined in c++26" +# endif +# if __cpp_lib_string_contains != 202011L +# error "__cpp_lib_string_contains should have the value 202011L in c++26" +# endif + +# ifndef __cpp_lib_string_resize_and_overwrite +# error "__cpp_lib_string_resize_and_overwrite should be defined in c++26" +# endif +# if __cpp_lib_string_resize_and_overwrite != 202110L +# error "__cpp_lib_string_resize_and_overwrite should have the value 202110L in c++26" +# endif + +# ifndef __cpp_lib_string_udls +# error "__cpp_lib_string_udls should be defined in c++26" +# endif +# if __cpp_lib_string_udls != 201304L +# error "__cpp_lib_string_udls should have the value 201304L in c++26" +# endif + +# ifndef __cpp_lib_string_view +# error "__cpp_lib_string_view should be defined in c++26" +# endif +# if __cpp_lib_string_view != 202403L +# error "__cpp_lib_string_view should have the value 202403L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_to_string +# error "__cpp_lib_to_string should be defined in c++26" +# endif +# if __cpp_lib_to_string != 202306L +# error "__cpp_lib_to_string should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_to_string +# error "__cpp_lib_to_string should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/string_view.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/string_view.version.compile.pass.cpp new file mode 100644 index 0000000000000..bda523614106c --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/string_view.version.compile.pass.cpp @@ -0,0 +1,252 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_string_view +# error "__cpp_lib_constexpr_string_view should not be defined before c++20" +# endif + +# ifdef __cpp_lib_freestanding_string_view +# error "__cpp_lib_freestanding_string_view should not be defined before c++26" +# endif + +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++20" +# endif + +# ifdef __cpp_lib_string_contains +# error "__cpp_lib_string_contains should not be defined before c++23" +# endif + +# ifdef __cpp_lib_string_view +# error "__cpp_lib_string_view should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_string_view +# error "__cpp_lib_constexpr_string_view should not be defined before c++20" +# endif + +# ifdef __cpp_lib_freestanding_string_view +# error "__cpp_lib_freestanding_string_view should not be defined before c++26" +# endif + +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++20" +# endif + +# ifdef __cpp_lib_string_contains +# error "__cpp_lib_string_contains should not be defined before c++23" +# endif + +# ifdef __cpp_lib_string_view +# error "__cpp_lib_string_view should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_string_view +# error "__cpp_lib_constexpr_string_view should not be defined before c++20" +# endif + +# ifdef __cpp_lib_freestanding_string_view +# error "__cpp_lib_freestanding_string_view should not be defined before c++26" +# endif + +# ifdef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should not be defined before c++20" +# endif + +# ifdef __cpp_lib_string_contains +# error "__cpp_lib_string_contains should not be defined before c++23" +# endif + +# ifndef __cpp_lib_string_view +# error "__cpp_lib_string_view should be defined in c++17" +# endif +# if __cpp_lib_string_view != 201606L +# error "__cpp_lib_string_view should have the value 201606L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++20" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +# ifndef __cpp_lib_constexpr_string_view +# error "__cpp_lib_constexpr_string_view should be defined in c++20" +# endif +# if __cpp_lib_constexpr_string_view != 201811L +# error "__cpp_lib_constexpr_string_view should have the value 201811L in c++20" +# endif + +# ifdef __cpp_lib_freestanding_string_view +# error "__cpp_lib_freestanding_string_view should not be defined before c++26" +# endif + +# ifndef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should be defined in c++20" +# endif +# if __cpp_lib_starts_ends_with != 201711L +# error "__cpp_lib_starts_ends_with should have the value 201711L in c++20" +# endif + +# ifdef __cpp_lib_string_contains +# error "__cpp_lib_string_contains should not be defined before c++23" +# endif + +# ifndef __cpp_lib_string_view +# error "__cpp_lib_string_view should be defined in c++20" +# endif +# if __cpp_lib_string_view != 201803L +# error "__cpp_lib_string_view should have the value 201803L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++23" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +# ifndef __cpp_lib_constexpr_string_view +# error "__cpp_lib_constexpr_string_view should be defined in c++23" +# endif +# if __cpp_lib_constexpr_string_view != 201811L +# error "__cpp_lib_constexpr_string_view should have the value 201811L in c++23" +# endif + +# ifdef __cpp_lib_freestanding_string_view +# error "__cpp_lib_freestanding_string_view should not be defined before c++26" +# endif + +# ifndef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should be defined in c++23" +# endif +# if __cpp_lib_starts_ends_with != 201711L +# error "__cpp_lib_starts_ends_with should have the value 201711L in c++23" +# endif + +# ifndef __cpp_lib_string_contains +# error "__cpp_lib_string_contains should be defined in c++23" +# endif +# if __cpp_lib_string_contains != 202011L +# error "__cpp_lib_string_contains should have the value 202011L in c++23" +# endif + +# ifndef __cpp_lib_string_view +# error "__cpp_lib_string_view should be defined in c++23" +# endif +# if __cpp_lib_string_view != 201803L +# error "__cpp_lib_string_view should have the value 201803L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# if defined(__cpp_char8_t) +# ifndef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should be defined in c++26" +# endif +# if __cpp_lib_char8_t != 201907L +# error "__cpp_lib_char8_t should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_char8_t +# error "__cpp_lib_char8_t should not be defined when the requirement 'defined(__cpp_char8_t)' is not met!" +# endif +# endif + +# ifndef __cpp_lib_constexpr_string_view +# error "__cpp_lib_constexpr_string_view should be defined in c++26" +# endif +# if __cpp_lib_constexpr_string_view != 201811L +# error "__cpp_lib_constexpr_string_view should have the value 201811L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_freestanding_string_view +# error "__cpp_lib_freestanding_string_view should be defined in c++26" +# endif +# if __cpp_lib_freestanding_string_view != 202311L +# error "__cpp_lib_freestanding_string_view should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_freestanding_string_view +# error "__cpp_lib_freestanding_string_view should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_starts_ends_with +# error "__cpp_lib_starts_ends_with should be defined in c++26" +# endif +# if __cpp_lib_starts_ends_with != 201711L +# error "__cpp_lib_starts_ends_with should have the value 201711L in c++26" +# endif + +# ifndef __cpp_lib_string_contains +# error "__cpp_lib_string_contains should be defined in c++26" +# endif +# if __cpp_lib_string_contains != 202011L +# error "__cpp_lib_string_contains should have the value 202011L in c++26" +# endif + +# ifndef __cpp_lib_string_view +# error "__cpp_lib_string_view should be defined in c++26" +# endif +# if __cpp_lib_string_view != 202403L +# error "__cpp_lib_string_view should have the value 202403L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/syncstream.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/syncstream.version.compile.pass.cpp new file mode 100644 index 0000000000000..0eaf9f1aff4fe --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/syncstream.version.compile.pass.cpp @@ -0,0 +1,89 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-localization + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_syncbuf +# error "__cpp_lib_syncbuf should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_syncbuf +# error "__cpp_lib_syncbuf should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_syncbuf +# error "__cpp_lib_syncbuf should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM +# ifndef __cpp_lib_syncbuf +# error "__cpp_lib_syncbuf should be defined in c++20" +# endif +# if __cpp_lib_syncbuf != 201803L +# error "__cpp_lib_syncbuf should have the value 201803L in c++20" +# endif +# else +# ifdef __cpp_lib_syncbuf +# error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM +# ifndef __cpp_lib_syncbuf +# error "__cpp_lib_syncbuf should be defined in c++23" +# endif +# if __cpp_lib_syncbuf != 201803L +# error "__cpp_lib_syncbuf should have the value 201803L in c++23" +# endif +# else +# ifdef __cpp_lib_syncbuf +# error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM +# ifndef __cpp_lib_syncbuf +# error "__cpp_lib_syncbuf should be defined in c++26" +# endif +# if __cpp_lib_syncbuf != 201803L +# error "__cpp_lib_syncbuf should have the value 201803L in c++26" +# endif +# else +# ifdef __cpp_lib_syncbuf +# error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/text_encoding.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/text_encoding.version.compile.pass.cpp new file mode 100644 index 0000000000000..3fe3f33fa6f35 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/text_encoding.version.compile.pass.cpp @@ -0,0 +1,71 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#if __has_include() +# include +#endif +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_text_encoding +# error "__cpp_lib_text_encoding should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_text_encoding +# error "__cpp_lib_text_encoding should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_text_encoding +# error "__cpp_lib_text_encoding should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_text_encoding +# error "__cpp_lib_text_encoding should not be defined before c++26" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_text_encoding +# error "__cpp_lib_text_encoding should not be defined before c++26" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_text_encoding +# error "__cpp_lib_text_encoding should be defined in c++26" +# endif +# if __cpp_lib_text_encoding != 202306L +# error "__cpp_lib_text_encoding should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_text_encoding +# error "__cpp_lib_text_encoding should not be defined because it is unimplemented in libc++!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/thread.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/thread.version.compile.pass.cpp new file mode 100644 index 0000000000000..e6c44a223ee89 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/thread.version.compile.pass.cpp @@ -0,0 +1,131 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// UNSUPPORTED: no-threads + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_formatters +# error "__cpp_lib_formatters should not be defined before c++23" +# endif + +# ifdef __cpp_lib_jthread +# error "__cpp_lib_jthread should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_formatters +# error "__cpp_lib_formatters should not be defined before c++23" +# endif + +# ifdef __cpp_lib_jthread +# error "__cpp_lib_jthread should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_formatters +# error "__cpp_lib_formatters should not be defined before c++23" +# endif + +# ifdef __cpp_lib_jthread +# error "__cpp_lib_jthread should not be defined before c++20" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_formatters +# error "__cpp_lib_formatters should not be defined before c++23" +# endif + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_jthread +# error "__cpp_lib_jthread should be defined in c++20" +# endif +# if __cpp_lib_jthread != 201911L +# error "__cpp_lib_jthread should have the value 201911L in c++20" +# endif +# else +# ifdef __cpp_lib_jthread +# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#elif TEST_STD_VER == 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_formatters +# error "__cpp_lib_formatters should be defined in c++23" +# endif +# if __cpp_lib_formatters != 202302L +# error "__cpp_lib_formatters should have the value 202302L in c++23" +# endif +# else +# ifdef __cpp_lib_formatters +# error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_jthread +# error "__cpp_lib_jthread should be defined in c++23" +# endif +# if __cpp_lib_jthread != 201911L +# error "__cpp_lib_jthread should have the value 201911L in c++23" +# endif +# else +# ifdef __cpp_lib_jthread +# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_formatters +# error "__cpp_lib_formatters should be defined in c++26" +# endif +# if __cpp_lib_formatters != 202302L +# error "__cpp_lib_formatters should have the value 202302L in c++26" +# endif +# else +# ifdef __cpp_lib_formatters +# error "__cpp_lib_formatters should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC) +# ifndef __cpp_lib_jthread +# error "__cpp_lib_jthread should be defined in c++26" +# endif +# if __cpp_lib_jthread != 201911L +# error "__cpp_lib_jthread should have the value 201911L in c++26" +# endif +# else +# ifdef __cpp_lib_jthread +# error "__cpp_lib_jthread should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)' is not met!" +# endif +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/tuple.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/tuple.version.compile.pass.cpp new file mode 100644 index 0000000000000..f4a2fd8b29f45 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/tuple.version.compile.pass.cpp @@ -0,0 +1,336 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_apply +# error "__cpp_lib_apply should not be defined before c++17" +# endif + +# ifdef __cpp_lib_constexpr_tuple +# error "__cpp_lib_constexpr_tuple should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_make_from_tuple +# error "__cpp_lib_make_from_tuple should not be defined before c++17" +# endif + +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined before c++23" +# endif + +# ifdef __cpp_lib_tuple_element_t +# error "__cpp_lib_tuple_element_t should not be defined before c++14" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +# ifdef __cpp_lib_tuples_by_type +# error "__cpp_lib_tuples_by_type should not be defined before c++14" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_apply +# error "__cpp_lib_apply should not be defined before c++17" +# endif + +# ifdef __cpp_lib_constexpr_tuple +# error "__cpp_lib_constexpr_tuple should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_make_from_tuple +# error "__cpp_lib_make_from_tuple should not be defined before c++17" +# endif + +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined before c++23" +# endif + +# ifndef __cpp_lib_tuple_element_t +# error "__cpp_lib_tuple_element_t should be defined in c++14" +# endif +# if __cpp_lib_tuple_element_t != 201402L +# error "__cpp_lib_tuple_element_t should have the value 201402L in c++14" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +# ifndef __cpp_lib_tuples_by_type +# error "__cpp_lib_tuples_by_type should be defined in c++14" +# endif +# if __cpp_lib_tuples_by_type != 201304L +# error "__cpp_lib_tuples_by_type should have the value 201304L in c++14" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_apply +# error "__cpp_lib_apply should be defined in c++17" +# endif +# if __cpp_lib_apply != 201603L +# error "__cpp_lib_apply should have the value 201603L in c++17" +# endif + +# ifdef __cpp_lib_constexpr_tuple +# error "__cpp_lib_constexpr_tuple should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifndef __cpp_lib_make_from_tuple +# error "__cpp_lib_make_from_tuple should be defined in c++17" +# endif +# if __cpp_lib_make_from_tuple != 201606L +# error "__cpp_lib_make_from_tuple should have the value 201606L in c++17" +# endif + +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined before c++23" +# endif + +# ifndef __cpp_lib_tuple_element_t +# error "__cpp_lib_tuple_element_t should be defined in c++17" +# endif +# if __cpp_lib_tuple_element_t != 201402L +# error "__cpp_lib_tuple_element_t should have the value 201402L in c++17" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +# ifndef __cpp_lib_tuples_by_type +# error "__cpp_lib_tuples_by_type should be defined in c++17" +# endif +# if __cpp_lib_tuples_by_type != 201304L +# error "__cpp_lib_tuples_by_type should have the value 201304L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_apply +# error "__cpp_lib_apply should be defined in c++20" +# endif +# if __cpp_lib_apply != 201603L +# error "__cpp_lib_apply should have the value 201603L in c++20" +# endif + +# ifndef __cpp_lib_constexpr_tuple +# error "__cpp_lib_constexpr_tuple should be defined in c++20" +# endif +# if __cpp_lib_constexpr_tuple != 201811L +# error "__cpp_lib_constexpr_tuple should have the value 201811L in c++20" +# endif + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifndef __cpp_lib_make_from_tuple +# error "__cpp_lib_make_from_tuple should be defined in c++20" +# endif +# if __cpp_lib_make_from_tuple != 201606L +# error "__cpp_lib_make_from_tuple should have the value 201606L in c++20" +# endif + +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined before c++23" +# endif + +# ifndef __cpp_lib_tuple_element_t +# error "__cpp_lib_tuple_element_t should be defined in c++20" +# endif +# if __cpp_lib_tuple_element_t != 201402L +# error "__cpp_lib_tuple_element_t should have the value 201402L in c++20" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +# ifndef __cpp_lib_tuples_by_type +# error "__cpp_lib_tuples_by_type should be defined in c++20" +# endif +# if __cpp_lib_tuples_by_type != 201304L +# error "__cpp_lib_tuples_by_type should have the value 201304L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_apply +# error "__cpp_lib_apply should be defined in c++23" +# endif +# if __cpp_lib_apply != 201603L +# error "__cpp_lib_apply should have the value 201603L in c++23" +# endif + +# ifndef __cpp_lib_constexpr_tuple +# error "__cpp_lib_constexpr_tuple should be defined in c++23" +# endif +# if __cpp_lib_constexpr_tuple != 201811L +# error "__cpp_lib_constexpr_tuple should have the value 201811L in c++23" +# endif + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifndef __cpp_lib_make_from_tuple +# error "__cpp_lib_make_from_tuple should be defined in c++23" +# endif +# if __cpp_lib_make_from_tuple != 201606L +# error "__cpp_lib_make_from_tuple should have the value 201606L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should be defined in c++23" +# endif +# if __cpp_lib_ranges_zip != 202110L +# error "__cpp_lib_ranges_zip should have the value 202110L in c++23" +# endif +# else +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_tuple_element_t +# error "__cpp_lib_tuple_element_t should be defined in c++23" +# endif +# if __cpp_lib_tuple_element_t != 201402L +# error "__cpp_lib_tuple_element_t should have the value 201402L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should be defined in c++23" +# endif +# if __cpp_lib_tuple_like != 202207L +# error "__cpp_lib_tuple_like should have the value 202207L in c++23" +# endif +# else +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_tuples_by_type +# error "__cpp_lib_tuples_by_type should be defined in c++23" +# endif +# if __cpp_lib_tuples_by_type != 201304L +# error "__cpp_lib_tuples_by_type should have the value 201304L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_apply +# error "__cpp_lib_apply should be defined in c++26" +# endif +# if __cpp_lib_apply != 201603L +# error "__cpp_lib_apply should have the value 201603L in c++26" +# endif + +# ifndef __cpp_lib_constexpr_tuple +# error "__cpp_lib_constexpr_tuple should be defined in c++26" +# endif +# if __cpp_lib_constexpr_tuple != 201811L +# error "__cpp_lib_constexpr_tuple should have the value 201811L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should be defined in c++26" +# endif +# if __cpp_lib_constrained_equality != 202403L +# error "__cpp_lib_constrained_equality should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_make_from_tuple +# error "__cpp_lib_make_from_tuple should be defined in c++26" +# endif +# if __cpp_lib_make_from_tuple != 201606L +# error "__cpp_lib_make_from_tuple should have the value 201606L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should be defined in c++26" +# endif +# if __cpp_lib_ranges_zip != 202110L +# error "__cpp_lib_ranges_zip should have the value 202110L in c++26" +# endif +# else +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_tuple_element_t +# error "__cpp_lib_tuple_element_t should be defined in c++26" +# endif +# if __cpp_lib_tuple_element_t != 201402L +# error "__cpp_lib_tuple_element_t should have the value 201402L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should be defined in c++26" +# endif +# if __cpp_lib_tuple_like != 202311L +# error "__cpp_lib_tuple_like should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_tuples_by_type +# error "__cpp_lib_tuples_by_type should be defined in c++26" +# endif +# if __cpp_lib_tuples_by_type != 201304L +# error "__cpp_lib_tuples_by_type should have the value 201304L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/type_traits.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/type_traits.version.compile.pass.cpp new file mode 100644 index 0000000000000..45c51b5807c69 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/type_traits.version.compile.pass.cpp @@ -0,0 +1,966 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_bool_constant +# error "__cpp_lib_bool_constant should not be defined before c++17" +# endif + +# ifdef __cpp_lib_bounded_array_traits +# error "__cpp_lib_bounded_array_traits should not be defined before c++20" +# endif + +# ifdef __cpp_lib_has_unique_object_representations +# error "__cpp_lib_has_unique_object_representations should not be defined before c++17" +# endif + +# ifdef __cpp_lib_integral_constant_callable +# error "__cpp_lib_integral_constant_callable should not be defined before c++14" +# endif + +# ifdef __cpp_lib_is_aggregate +# error "__cpp_lib_is_aggregate should not be defined before c++17" +# endif + +# ifdef __cpp_lib_is_constant_evaluated +# error "__cpp_lib_is_constant_evaluated should not be defined before c++20" +# endif + +# ifdef __cpp_lib_is_final +# error "__cpp_lib_is_final should not be defined before c++14" +# endif + +# ifdef __cpp_lib_is_implicit_lifetime +# error "__cpp_lib_is_implicit_lifetime should not be defined before c++23" +# endif + +# ifdef __cpp_lib_is_invocable +# error "__cpp_lib_is_invocable should not be defined before c++17" +# endif + +# ifdef __cpp_lib_is_layout_compatible +# error "__cpp_lib_is_layout_compatible should not be defined before c++20" +# endif + +# ifdef __cpp_lib_is_nothrow_convertible +# error "__cpp_lib_is_nothrow_convertible should not be defined before c++20" +# endif + +# ifdef __cpp_lib_is_null_pointer +# error "__cpp_lib_is_null_pointer should not be defined before c++14" +# endif + +# ifdef __cpp_lib_is_pointer_interconvertible +# error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20" +# endif + +# ifdef __cpp_lib_is_scoped_enum +# error "__cpp_lib_is_scoped_enum should not be defined before c++23" +# endif + +# ifdef __cpp_lib_is_swappable +# error "__cpp_lib_is_swappable should not be defined before c++17" +# endif + +# ifdef __cpp_lib_is_virtual_base_of +# error "__cpp_lib_is_virtual_base_of should not be defined before c++26" +# endif + +# ifdef __cpp_lib_is_within_lifetime +# error "__cpp_lib_is_within_lifetime should not be defined before c++26" +# endif + +# ifdef __cpp_lib_logical_traits +# error "__cpp_lib_logical_traits should not be defined before c++17" +# endif + +# ifdef __cpp_lib_reference_from_temporary +# error "__cpp_lib_reference_from_temporary should not be defined before c++23" +# endif + +# ifdef __cpp_lib_remove_cvref +# error "__cpp_lib_remove_cvref should not be defined before c++20" +# endif + +# ifdef __cpp_lib_result_of_sfinae +# error "__cpp_lib_result_of_sfinae should not be defined before c++14" +# endif + +# ifdef __cpp_lib_transformation_trait_aliases +# error "__cpp_lib_transformation_trait_aliases should not be defined before c++14" +# endif + +# ifdef __cpp_lib_type_identity +# error "__cpp_lib_type_identity should not be defined before c++20" +# endif + +# ifdef __cpp_lib_type_trait_variable_templates +# error "__cpp_lib_type_trait_variable_templates should not be defined before c++17" +# endif + +# ifdef __cpp_lib_void_t +# error "__cpp_lib_void_t should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_bool_constant +# error "__cpp_lib_bool_constant should not be defined before c++17" +# endif + +# ifdef __cpp_lib_bounded_array_traits +# error "__cpp_lib_bounded_array_traits should not be defined before c++20" +# endif + +# ifdef __cpp_lib_has_unique_object_representations +# error "__cpp_lib_has_unique_object_representations should not be defined before c++17" +# endif + +# ifndef __cpp_lib_integral_constant_callable +# error "__cpp_lib_integral_constant_callable should be defined in c++14" +# endif +# if __cpp_lib_integral_constant_callable != 201304L +# error "__cpp_lib_integral_constant_callable should have the value 201304L in c++14" +# endif + +# ifdef __cpp_lib_is_aggregate +# error "__cpp_lib_is_aggregate should not be defined before c++17" +# endif + +# ifdef __cpp_lib_is_constant_evaluated +# error "__cpp_lib_is_constant_evaluated should not be defined before c++20" +# endif + +# ifndef __cpp_lib_is_final +# error "__cpp_lib_is_final should be defined in c++14" +# endif +# if __cpp_lib_is_final != 201402L +# error "__cpp_lib_is_final should have the value 201402L in c++14" +# endif + +# ifdef __cpp_lib_is_implicit_lifetime +# error "__cpp_lib_is_implicit_lifetime should not be defined before c++23" +# endif + +# ifdef __cpp_lib_is_invocable +# error "__cpp_lib_is_invocable should not be defined before c++17" +# endif + +# ifdef __cpp_lib_is_layout_compatible +# error "__cpp_lib_is_layout_compatible should not be defined before c++20" +# endif + +# ifdef __cpp_lib_is_nothrow_convertible +# error "__cpp_lib_is_nothrow_convertible should not be defined before c++20" +# endif + +# ifndef __cpp_lib_is_null_pointer +# error "__cpp_lib_is_null_pointer should be defined in c++14" +# endif +# if __cpp_lib_is_null_pointer != 201309L +# error "__cpp_lib_is_null_pointer should have the value 201309L in c++14" +# endif + +# ifdef __cpp_lib_is_pointer_interconvertible +# error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20" +# endif + +# ifdef __cpp_lib_is_scoped_enum +# error "__cpp_lib_is_scoped_enum should not be defined before c++23" +# endif + +# ifdef __cpp_lib_is_swappable +# error "__cpp_lib_is_swappable should not be defined before c++17" +# endif + +# ifdef __cpp_lib_is_virtual_base_of +# error "__cpp_lib_is_virtual_base_of should not be defined before c++26" +# endif + +# ifdef __cpp_lib_is_within_lifetime +# error "__cpp_lib_is_within_lifetime should not be defined before c++26" +# endif + +# ifdef __cpp_lib_logical_traits +# error "__cpp_lib_logical_traits should not be defined before c++17" +# endif + +# ifdef __cpp_lib_reference_from_temporary +# error "__cpp_lib_reference_from_temporary should not be defined before c++23" +# endif + +# ifdef __cpp_lib_remove_cvref +# error "__cpp_lib_remove_cvref should not be defined before c++20" +# endif + +# ifndef __cpp_lib_result_of_sfinae +# error "__cpp_lib_result_of_sfinae should be defined in c++14" +# endif +# if __cpp_lib_result_of_sfinae != 201210L +# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++14" +# endif + +# ifndef __cpp_lib_transformation_trait_aliases +# error "__cpp_lib_transformation_trait_aliases should be defined in c++14" +# endif +# if __cpp_lib_transformation_trait_aliases != 201304L +# error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++14" +# endif + +# ifdef __cpp_lib_type_identity +# error "__cpp_lib_type_identity should not be defined before c++20" +# endif + +# ifdef __cpp_lib_type_trait_variable_templates +# error "__cpp_lib_type_trait_variable_templates should not be defined before c++17" +# endif + +# ifdef __cpp_lib_void_t +# error "__cpp_lib_void_t should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_bool_constant +# error "__cpp_lib_bool_constant should be defined in c++17" +# endif +# if __cpp_lib_bool_constant != 201505L +# error "__cpp_lib_bool_constant should have the value 201505L in c++17" +# endif + +# ifdef __cpp_lib_bounded_array_traits +# error "__cpp_lib_bounded_array_traits should not be defined before c++20" +# endif + +# ifndef __cpp_lib_has_unique_object_representations +# error "__cpp_lib_has_unique_object_representations should be defined in c++17" +# endif +# if __cpp_lib_has_unique_object_representations != 201606L +# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++17" +# endif + +# ifndef __cpp_lib_integral_constant_callable +# error "__cpp_lib_integral_constant_callable should be defined in c++17" +# endif +# if __cpp_lib_integral_constant_callable != 201304L +# error "__cpp_lib_integral_constant_callable should have the value 201304L in c++17" +# endif + +# ifndef __cpp_lib_is_aggregate +# error "__cpp_lib_is_aggregate should be defined in c++17" +# endif +# if __cpp_lib_is_aggregate != 201703L +# error "__cpp_lib_is_aggregate should have the value 201703L in c++17" +# endif + +# ifdef __cpp_lib_is_constant_evaluated +# error "__cpp_lib_is_constant_evaluated should not be defined before c++20" +# endif + +# ifndef __cpp_lib_is_final +# error "__cpp_lib_is_final should be defined in c++17" +# endif +# if __cpp_lib_is_final != 201402L +# error "__cpp_lib_is_final should have the value 201402L in c++17" +# endif + +# ifdef __cpp_lib_is_implicit_lifetime +# error "__cpp_lib_is_implicit_lifetime should not be defined before c++23" +# endif + +# ifndef __cpp_lib_is_invocable +# error "__cpp_lib_is_invocable should be defined in c++17" +# endif +# if __cpp_lib_is_invocable != 201703L +# error "__cpp_lib_is_invocable should have the value 201703L in c++17" +# endif + +# ifdef __cpp_lib_is_layout_compatible +# error "__cpp_lib_is_layout_compatible should not be defined before c++20" +# endif + +# ifdef __cpp_lib_is_nothrow_convertible +# error "__cpp_lib_is_nothrow_convertible should not be defined before c++20" +# endif + +# ifndef __cpp_lib_is_null_pointer +# error "__cpp_lib_is_null_pointer should be defined in c++17" +# endif +# if __cpp_lib_is_null_pointer != 201309L +# error "__cpp_lib_is_null_pointer should have the value 201309L in c++17" +# endif + +# ifdef __cpp_lib_is_pointer_interconvertible +# error "__cpp_lib_is_pointer_interconvertible should not be defined before c++20" +# endif + +# ifdef __cpp_lib_is_scoped_enum +# error "__cpp_lib_is_scoped_enum should not be defined before c++23" +# endif + +# ifndef __cpp_lib_is_swappable +# error "__cpp_lib_is_swappable should be defined in c++17" +# endif +# if __cpp_lib_is_swappable != 201603L +# error "__cpp_lib_is_swappable should have the value 201603L in c++17" +# endif + +# ifdef __cpp_lib_is_virtual_base_of +# error "__cpp_lib_is_virtual_base_of should not be defined before c++26" +# endif + +# ifdef __cpp_lib_is_within_lifetime +# error "__cpp_lib_is_within_lifetime should not be defined before c++26" +# endif + +# ifndef __cpp_lib_logical_traits +# error "__cpp_lib_logical_traits should be defined in c++17" +# endif +# if __cpp_lib_logical_traits != 201510L +# error "__cpp_lib_logical_traits should have the value 201510L in c++17" +# endif + +# ifdef __cpp_lib_reference_from_temporary +# error "__cpp_lib_reference_from_temporary should not be defined before c++23" +# endif + +# ifdef __cpp_lib_remove_cvref +# error "__cpp_lib_remove_cvref should not be defined before c++20" +# endif + +# ifndef __cpp_lib_result_of_sfinae +# error "__cpp_lib_result_of_sfinae should be defined in c++17" +# endif +# if __cpp_lib_result_of_sfinae != 201210L +# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17" +# endif + +# ifndef __cpp_lib_transformation_trait_aliases +# error "__cpp_lib_transformation_trait_aliases should be defined in c++17" +# endif +# if __cpp_lib_transformation_trait_aliases != 201304L +# error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++17" +# endif + +# ifdef __cpp_lib_type_identity +# error "__cpp_lib_type_identity should not be defined before c++20" +# endif + +# ifndef __cpp_lib_type_trait_variable_templates +# error "__cpp_lib_type_trait_variable_templates should be defined in c++17" +# endif +# if __cpp_lib_type_trait_variable_templates != 201510L +# error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++17" +# endif + +# ifndef __cpp_lib_void_t +# error "__cpp_lib_void_t should be defined in c++17" +# endif +# if __cpp_lib_void_t != 201411L +# error "__cpp_lib_void_t should have the value 201411L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_bool_constant +# error "__cpp_lib_bool_constant should be defined in c++20" +# endif +# if __cpp_lib_bool_constant != 201505L +# error "__cpp_lib_bool_constant should have the value 201505L in c++20" +# endif + +# ifndef __cpp_lib_bounded_array_traits +# error "__cpp_lib_bounded_array_traits should be defined in c++20" +# endif +# if __cpp_lib_bounded_array_traits != 201902L +# error "__cpp_lib_bounded_array_traits should have the value 201902L in c++20" +# endif + +# ifndef __cpp_lib_has_unique_object_representations +# error "__cpp_lib_has_unique_object_representations should be defined in c++20" +# endif +# if __cpp_lib_has_unique_object_representations != 201606L +# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++20" +# endif + +# ifndef __cpp_lib_integral_constant_callable +# error "__cpp_lib_integral_constant_callable should be defined in c++20" +# endif +# if __cpp_lib_integral_constant_callable != 201304L +# error "__cpp_lib_integral_constant_callable should have the value 201304L in c++20" +# endif + +# ifndef __cpp_lib_is_aggregate +# error "__cpp_lib_is_aggregate should be defined in c++20" +# endif +# if __cpp_lib_is_aggregate != 201703L +# error "__cpp_lib_is_aggregate should have the value 201703L in c++20" +# endif + +# ifndef __cpp_lib_is_constant_evaluated +# error "__cpp_lib_is_constant_evaluated should be defined in c++20" +# endif +# if __cpp_lib_is_constant_evaluated != 201811L +# error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++20" +# endif + +# ifndef __cpp_lib_is_final +# error "__cpp_lib_is_final should be defined in c++20" +# endif +# if __cpp_lib_is_final != 201402L +# error "__cpp_lib_is_final should have the value 201402L in c++20" +# endif + +# ifdef __cpp_lib_is_implicit_lifetime +# error "__cpp_lib_is_implicit_lifetime should not be defined before c++23" +# endif + +# ifndef __cpp_lib_is_invocable +# error "__cpp_lib_is_invocable should be defined in c++20" +# endif +# if __cpp_lib_is_invocable != 201703L +# error "__cpp_lib_is_invocable should have the value 201703L in c++20" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_is_layout_compatible +# error "__cpp_lib_is_layout_compatible should be defined in c++20" +# endif +# if __cpp_lib_is_layout_compatible != 201907L +# error "__cpp_lib_is_layout_compatible should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_is_layout_compatible +# error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_is_nothrow_convertible +# error "__cpp_lib_is_nothrow_convertible should be defined in c++20" +# endif +# if __cpp_lib_is_nothrow_convertible != 201806L +# error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++20" +# endif + +# ifndef __cpp_lib_is_null_pointer +# error "__cpp_lib_is_null_pointer should be defined in c++20" +# endif +# if __cpp_lib_is_null_pointer != 201309L +# error "__cpp_lib_is_null_pointer should have the value 201309L in c++20" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_is_pointer_interconvertible +# error "__cpp_lib_is_pointer_interconvertible should be defined in c++20" +# endif +# if __cpp_lib_is_pointer_interconvertible != 201907L +# error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++20" +# endif +# else +# ifdef __cpp_lib_is_pointer_interconvertible +# error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifdef __cpp_lib_is_scoped_enum +# error "__cpp_lib_is_scoped_enum should not be defined before c++23" +# endif + +# ifndef __cpp_lib_is_swappable +# error "__cpp_lib_is_swappable should be defined in c++20" +# endif +# if __cpp_lib_is_swappable != 201603L +# error "__cpp_lib_is_swappable should have the value 201603L in c++20" +# endif + +# ifdef __cpp_lib_is_virtual_base_of +# error "__cpp_lib_is_virtual_base_of should not be defined before c++26" +# endif + +# ifdef __cpp_lib_is_within_lifetime +# error "__cpp_lib_is_within_lifetime should not be defined before c++26" +# endif + +# ifndef __cpp_lib_logical_traits +# error "__cpp_lib_logical_traits should be defined in c++20" +# endif +# if __cpp_lib_logical_traits != 201510L +# error "__cpp_lib_logical_traits should have the value 201510L in c++20" +# endif + +# ifdef __cpp_lib_reference_from_temporary +# error "__cpp_lib_reference_from_temporary should not be defined before c++23" +# endif + +# ifndef __cpp_lib_remove_cvref +# error "__cpp_lib_remove_cvref should be defined in c++20" +# endif +# if __cpp_lib_remove_cvref != 201711L +# error "__cpp_lib_remove_cvref should have the value 201711L in c++20" +# endif + +# ifndef __cpp_lib_result_of_sfinae +# error "__cpp_lib_result_of_sfinae should be defined in c++20" +# endif +# if __cpp_lib_result_of_sfinae != 201210L +# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++20" +# endif + +# ifndef __cpp_lib_transformation_trait_aliases +# error "__cpp_lib_transformation_trait_aliases should be defined in c++20" +# endif +# if __cpp_lib_transformation_trait_aliases != 201304L +# error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++20" +# endif + +# ifndef __cpp_lib_type_identity +# error "__cpp_lib_type_identity should be defined in c++20" +# endif +# if __cpp_lib_type_identity != 201806L +# error "__cpp_lib_type_identity should have the value 201806L in c++20" +# endif + +# ifndef __cpp_lib_type_trait_variable_templates +# error "__cpp_lib_type_trait_variable_templates should be defined in c++20" +# endif +# if __cpp_lib_type_trait_variable_templates != 201510L +# error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++20" +# endif + +# ifndef __cpp_lib_void_t +# error "__cpp_lib_void_t should be defined in c++20" +# endif +# if __cpp_lib_void_t != 201411L +# error "__cpp_lib_void_t should have the value 201411L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_bool_constant +# error "__cpp_lib_bool_constant should be defined in c++23" +# endif +# if __cpp_lib_bool_constant != 201505L +# error "__cpp_lib_bool_constant should have the value 201505L in c++23" +# endif + +# ifndef __cpp_lib_bounded_array_traits +# error "__cpp_lib_bounded_array_traits should be defined in c++23" +# endif +# if __cpp_lib_bounded_array_traits != 201902L +# error "__cpp_lib_bounded_array_traits should have the value 201902L in c++23" +# endif + +# ifndef __cpp_lib_has_unique_object_representations +# error "__cpp_lib_has_unique_object_representations should be defined in c++23" +# endif +# if __cpp_lib_has_unique_object_representations != 201606L +# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++23" +# endif + +# ifndef __cpp_lib_integral_constant_callable +# error "__cpp_lib_integral_constant_callable should be defined in c++23" +# endif +# if __cpp_lib_integral_constant_callable != 201304L +# error "__cpp_lib_integral_constant_callable should have the value 201304L in c++23" +# endif + +# ifndef __cpp_lib_is_aggregate +# error "__cpp_lib_is_aggregate should be defined in c++23" +# endif +# if __cpp_lib_is_aggregate != 201703L +# error "__cpp_lib_is_aggregate should have the value 201703L in c++23" +# endif + +# ifndef __cpp_lib_is_constant_evaluated +# error "__cpp_lib_is_constant_evaluated should be defined in c++23" +# endif +# if __cpp_lib_is_constant_evaluated != 201811L +# error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++23" +# endif + +# ifndef __cpp_lib_is_final +# error "__cpp_lib_is_final should be defined in c++23" +# endif +# if __cpp_lib_is_final != 201402L +# error "__cpp_lib_is_final should have the value 201402L in c++23" +# endif + +# if __has_builtin(__builtin_is_implicit_lifetime) +# ifndef __cpp_lib_is_implicit_lifetime +# error "__cpp_lib_is_implicit_lifetime should be defined in c++23" +# endif +# if __cpp_lib_is_implicit_lifetime != 202302L +# error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++23" +# endif +# else +# ifdef __cpp_lib_is_implicit_lifetime +# error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!" +# endif +# endif + +# ifndef __cpp_lib_is_invocable +# error "__cpp_lib_is_invocable should be defined in c++23" +# endif +# if __cpp_lib_is_invocable != 201703L +# error "__cpp_lib_is_invocable should have the value 201703L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_is_layout_compatible +# error "__cpp_lib_is_layout_compatible should be defined in c++23" +# endif +# if __cpp_lib_is_layout_compatible != 201907L +# error "__cpp_lib_is_layout_compatible should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_is_layout_compatible +# error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_is_nothrow_convertible +# error "__cpp_lib_is_nothrow_convertible should be defined in c++23" +# endif +# if __cpp_lib_is_nothrow_convertible != 201806L +# error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++23" +# endif + +# ifndef __cpp_lib_is_null_pointer +# error "__cpp_lib_is_null_pointer should be defined in c++23" +# endif +# if __cpp_lib_is_null_pointer != 201309L +# error "__cpp_lib_is_null_pointer should have the value 201309L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_is_pointer_interconvertible +# error "__cpp_lib_is_pointer_interconvertible should be defined in c++23" +# endif +# if __cpp_lib_is_pointer_interconvertible != 201907L +# error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++23" +# endif +# else +# ifdef __cpp_lib_is_pointer_interconvertible +# error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_is_scoped_enum +# error "__cpp_lib_is_scoped_enum should be defined in c++23" +# endif +# if __cpp_lib_is_scoped_enum != 202011L +# error "__cpp_lib_is_scoped_enum should have the value 202011L in c++23" +# endif + +# ifndef __cpp_lib_is_swappable +# error "__cpp_lib_is_swappable should be defined in c++23" +# endif +# if __cpp_lib_is_swappable != 201603L +# error "__cpp_lib_is_swappable should have the value 201603L in c++23" +# endif + +# ifdef __cpp_lib_is_virtual_base_of +# error "__cpp_lib_is_virtual_base_of should not be defined before c++26" +# endif + +# ifdef __cpp_lib_is_within_lifetime +# error "__cpp_lib_is_within_lifetime should not be defined before c++26" +# endif + +# ifndef __cpp_lib_logical_traits +# error "__cpp_lib_logical_traits should be defined in c++23" +# endif +# if __cpp_lib_logical_traits != 201510L +# error "__cpp_lib_logical_traits should have the value 201510L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_reference_from_temporary +# error "__cpp_lib_reference_from_temporary should be defined in c++23" +# endif +# if __cpp_lib_reference_from_temporary != 202202L +# error "__cpp_lib_reference_from_temporary should have the value 202202L in c++23" +# endif +# else +# ifdef __cpp_lib_reference_from_temporary +# error "__cpp_lib_reference_from_temporary should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_remove_cvref +# error "__cpp_lib_remove_cvref should be defined in c++23" +# endif +# if __cpp_lib_remove_cvref != 201711L +# error "__cpp_lib_remove_cvref should have the value 201711L in c++23" +# endif + +# ifndef __cpp_lib_result_of_sfinae +# error "__cpp_lib_result_of_sfinae should be defined in c++23" +# endif +# if __cpp_lib_result_of_sfinae != 201210L +# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++23" +# endif + +# ifndef __cpp_lib_transformation_trait_aliases +# error "__cpp_lib_transformation_trait_aliases should be defined in c++23" +# endif +# if __cpp_lib_transformation_trait_aliases != 201304L +# error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++23" +# endif + +# ifndef __cpp_lib_type_identity +# error "__cpp_lib_type_identity should be defined in c++23" +# endif +# if __cpp_lib_type_identity != 201806L +# error "__cpp_lib_type_identity should have the value 201806L in c++23" +# endif + +# ifndef __cpp_lib_type_trait_variable_templates +# error "__cpp_lib_type_trait_variable_templates should be defined in c++23" +# endif +# if __cpp_lib_type_trait_variable_templates != 201510L +# error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++23" +# endif + +# ifndef __cpp_lib_void_t +# error "__cpp_lib_void_t should be defined in c++23" +# endif +# if __cpp_lib_void_t != 201411L +# error "__cpp_lib_void_t should have the value 201411L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_bool_constant +# error "__cpp_lib_bool_constant should be defined in c++26" +# endif +# if __cpp_lib_bool_constant != 201505L +# error "__cpp_lib_bool_constant should have the value 201505L in c++26" +# endif + +# ifndef __cpp_lib_bounded_array_traits +# error "__cpp_lib_bounded_array_traits should be defined in c++26" +# endif +# if __cpp_lib_bounded_array_traits != 201902L +# error "__cpp_lib_bounded_array_traits should have the value 201902L in c++26" +# endif + +# ifndef __cpp_lib_has_unique_object_representations +# error "__cpp_lib_has_unique_object_representations should be defined in c++26" +# endif +# if __cpp_lib_has_unique_object_representations != 201606L +# error "__cpp_lib_has_unique_object_representations should have the value 201606L in c++26" +# endif + +# ifndef __cpp_lib_integral_constant_callable +# error "__cpp_lib_integral_constant_callable should be defined in c++26" +# endif +# if __cpp_lib_integral_constant_callable != 201304L +# error "__cpp_lib_integral_constant_callable should have the value 201304L in c++26" +# endif + +# ifndef __cpp_lib_is_aggregate +# error "__cpp_lib_is_aggregate should be defined in c++26" +# endif +# if __cpp_lib_is_aggregate != 201703L +# error "__cpp_lib_is_aggregate should have the value 201703L in c++26" +# endif + +# ifndef __cpp_lib_is_constant_evaluated +# error "__cpp_lib_is_constant_evaluated should be defined in c++26" +# endif +# if __cpp_lib_is_constant_evaluated != 201811L +# error "__cpp_lib_is_constant_evaluated should have the value 201811L in c++26" +# endif + +# ifndef __cpp_lib_is_final +# error "__cpp_lib_is_final should be defined in c++26" +# endif +# if __cpp_lib_is_final != 201402L +# error "__cpp_lib_is_final should have the value 201402L in c++26" +# endif + +# if __has_builtin(__builtin_is_implicit_lifetime) +# ifndef __cpp_lib_is_implicit_lifetime +# error "__cpp_lib_is_implicit_lifetime should be defined in c++26" +# endif +# if __cpp_lib_is_implicit_lifetime != 202302L +# error "__cpp_lib_is_implicit_lifetime should have the value 202302L in c++26" +# endif +# else +# ifdef __cpp_lib_is_implicit_lifetime +# error "__cpp_lib_is_implicit_lifetime should not be defined when the requirement '__has_builtin(__builtin_is_implicit_lifetime)' is not met!" +# endif +# endif + +# ifndef __cpp_lib_is_invocable +# error "__cpp_lib_is_invocable should be defined in c++26" +# endif +# if __cpp_lib_is_invocable != 201703L +# error "__cpp_lib_is_invocable should have the value 201703L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_is_layout_compatible +# error "__cpp_lib_is_layout_compatible should be defined in c++26" +# endif +# if __cpp_lib_is_layout_compatible != 201907L +# error "__cpp_lib_is_layout_compatible should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_is_layout_compatible +# error "__cpp_lib_is_layout_compatible should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_is_nothrow_convertible +# error "__cpp_lib_is_nothrow_convertible should be defined in c++26" +# endif +# if __cpp_lib_is_nothrow_convertible != 201806L +# error "__cpp_lib_is_nothrow_convertible should have the value 201806L in c++26" +# endif + +# ifndef __cpp_lib_is_null_pointer +# error "__cpp_lib_is_null_pointer should be defined in c++26" +# endif +# if __cpp_lib_is_null_pointer != 201309L +# error "__cpp_lib_is_null_pointer should have the value 201309L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_is_pointer_interconvertible +# error "__cpp_lib_is_pointer_interconvertible should be defined in c++26" +# endif +# if __cpp_lib_is_pointer_interconvertible != 201907L +# error "__cpp_lib_is_pointer_interconvertible should have the value 201907L in c++26" +# endif +# else +# ifdef __cpp_lib_is_pointer_interconvertible +# error "__cpp_lib_is_pointer_interconvertible should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_is_scoped_enum +# error "__cpp_lib_is_scoped_enum should be defined in c++26" +# endif +# if __cpp_lib_is_scoped_enum != 202011L +# error "__cpp_lib_is_scoped_enum should have the value 202011L in c++26" +# endif + +# ifndef __cpp_lib_is_swappable +# error "__cpp_lib_is_swappable should be defined in c++26" +# endif +# if __cpp_lib_is_swappable != 201603L +# error "__cpp_lib_is_swappable should have the value 201603L in c++26" +# endif + +# if __has_builtin(__builtin_is_virtual_base_of) +# ifndef __cpp_lib_is_virtual_base_of +# error "__cpp_lib_is_virtual_base_of should be defined in c++26" +# endif +# if __cpp_lib_is_virtual_base_of != 202406L +# error "__cpp_lib_is_virtual_base_of should have the value 202406L in c++26" +# endif +# else +# ifdef __cpp_lib_is_virtual_base_of +# error "__cpp_lib_is_virtual_base_of should not be defined when the requirement '__has_builtin(__builtin_is_virtual_base_of)' is not met!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_is_within_lifetime +# error "__cpp_lib_is_within_lifetime should be defined in c++26" +# endif +# if __cpp_lib_is_within_lifetime != 202306L +# error "__cpp_lib_is_within_lifetime should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_is_within_lifetime +# error "__cpp_lib_is_within_lifetime should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_logical_traits +# error "__cpp_lib_logical_traits should be defined in c++26" +# endif +# if __cpp_lib_logical_traits != 201510L +# error "__cpp_lib_logical_traits should have the value 201510L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_reference_from_temporary +# error "__cpp_lib_reference_from_temporary should be defined in c++26" +# endif +# if __cpp_lib_reference_from_temporary != 202202L +# error "__cpp_lib_reference_from_temporary should have the value 202202L in c++26" +# endif +# else +# ifdef __cpp_lib_reference_from_temporary +# error "__cpp_lib_reference_from_temporary should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_remove_cvref +# error "__cpp_lib_remove_cvref should be defined in c++26" +# endif +# if __cpp_lib_remove_cvref != 201711L +# error "__cpp_lib_remove_cvref should have the value 201711L in c++26" +# endif + +# ifndef __cpp_lib_result_of_sfinae +# error "__cpp_lib_result_of_sfinae should be defined in c++26" +# endif +# if __cpp_lib_result_of_sfinae != 201210L +# error "__cpp_lib_result_of_sfinae should have the value 201210L in c++26" +# endif + +# ifndef __cpp_lib_transformation_trait_aliases +# error "__cpp_lib_transformation_trait_aliases should be defined in c++26" +# endif +# if __cpp_lib_transformation_trait_aliases != 201304L +# error "__cpp_lib_transformation_trait_aliases should have the value 201304L in c++26" +# endif + +# ifndef __cpp_lib_type_identity +# error "__cpp_lib_type_identity should be defined in c++26" +# endif +# if __cpp_lib_type_identity != 201806L +# error "__cpp_lib_type_identity should have the value 201806L in c++26" +# endif + +# ifndef __cpp_lib_type_trait_variable_templates +# error "__cpp_lib_type_trait_variable_templates should be defined in c++26" +# endif +# if __cpp_lib_type_trait_variable_templates != 201510L +# error "__cpp_lib_type_trait_variable_templates should have the value 201510L in c++26" +# endif + +# ifndef __cpp_lib_void_t +# error "__cpp_lib_void_t should be defined in c++26" +# endif +# if __cpp_lib_void_t != 201411L +# error "__cpp_lib_void_t should have the value 201411L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/typeinfo.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/typeinfo.version.compile.pass.cpp new file mode 100644 index 0000000000000..0729b0b37ee6a --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/typeinfo.version.compile.pass.cpp @@ -0,0 +1,66 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_constexpr_typeinfo +# error "__cpp_lib_constexpr_typeinfo should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_constexpr_typeinfo +# error "__cpp_lib_constexpr_typeinfo should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_constexpr_typeinfo +# error "__cpp_lib_constexpr_typeinfo should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_constexpr_typeinfo +# error "__cpp_lib_constexpr_typeinfo should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_constexpr_typeinfo +# error "__cpp_lib_constexpr_typeinfo should be defined in c++23" +# endif +# if __cpp_lib_constexpr_typeinfo != 202106L +# error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_constexpr_typeinfo +# error "__cpp_lib_constexpr_typeinfo should be defined in c++26" +# endif +# if __cpp_lib_constexpr_typeinfo != 202106L +# error "__cpp_lib_constexpr_typeinfo should have the value 202106L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/unordered_map.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/unordered_map.version.compile.pass.cpp new file mode 100644 index 0000000000000..74b3c8fff69b3 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/unordered_map.version.compile.pass.cpp @@ -0,0 +1,393 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_generic_unordered_lookup +# error "__cpp_lib_generic_unordered_lookup should not be defined before c++20" +# endif + +# ifdef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should not be defined before c++17" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +# ifdef __cpp_lib_unordered_map_try_emplace +# error "__cpp_lib_unordered_map_try_emplace should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_generic_unordered_lookup +# error "__cpp_lib_generic_unordered_lookup should not be defined before c++20" +# endif + +# ifdef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should not be defined before c++17" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +# ifdef __cpp_lib_unordered_map_try_emplace +# error "__cpp_lib_unordered_map_try_emplace should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_generic_unordered_lookup +# error "__cpp_lib_generic_unordered_lookup should not be defined before c++20" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++17" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++17" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++17" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +# ifndef __cpp_lib_unordered_map_try_emplace +# error "__cpp_lib_unordered_map_try_emplace should be defined in c++17" +# endif +# if __cpp_lib_unordered_map_try_emplace != 201411L +# error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++20" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++20" +# endif + +# ifndef __cpp_lib_generic_unordered_lookup +# error "__cpp_lib_generic_unordered_lookup should be defined in c++20" +# endif +# if __cpp_lib_generic_unordered_lookup != 201811L +# error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++20" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++20" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++20" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +# ifndef __cpp_lib_unordered_map_try_emplace +# error "__cpp_lib_unordered_map_try_emplace should be defined in c++20" +# endif +# if __cpp_lib_unordered_map_try_emplace != 201411L +# error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23" +# endif +# if __cpp_lib_associative_heterogeneous_erasure != 202110L +# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23" +# endif +# else +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++23" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++23" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++23" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++23" +# endif + +# ifndef __cpp_lib_generic_unordered_lookup +# error "__cpp_lib_generic_unordered_lookup should be defined in c++23" +# endif +# if __cpp_lib_generic_unordered_lookup != 201811L +# error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++23" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++23" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++23" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++23" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should be defined in c++23" +# endif +# if __cpp_lib_tuple_like != 202207L +# error "__cpp_lib_tuple_like should have the value 202207L in c++23" +# endif +# else +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_unordered_map_try_emplace +# error "__cpp_lib_unordered_map_try_emplace should be defined in c++23" +# endif +# if __cpp_lib_unordered_map_try_emplace != 201411L +# error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26" +# endif +# if __cpp_lib_associative_heterogeneous_erasure != 202110L +# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26" +# endif +# else +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26" +# endif +# if __cpp_lib_associative_heterogeneous_insertion != 202306L +# error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++26" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++26" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++26" +# endif + +# ifndef __cpp_lib_generic_unordered_lookup +# error "__cpp_lib_generic_unordered_lookup should be defined in c++26" +# endif +# if __cpp_lib_generic_unordered_lookup != 201811L +# error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++26" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++26" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++26" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should be defined in c++26" +# endif +# if __cpp_lib_tuple_like != 202311L +# error "__cpp_lib_tuple_like should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_unordered_map_try_emplace +# error "__cpp_lib_unordered_map_try_emplace should be defined in c++26" +# endif +# if __cpp_lib_unordered_map_try_emplace != 201411L +# error "__cpp_lib_unordered_map_try_emplace should have the value 201411L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/unordered_set.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/unordered_set.version.compile.pass.cpp new file mode 100644 index 0000000000000..9c400ddd2f657 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/unordered_set.version.compile.pass.cpp @@ -0,0 +1,315 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_generic_unordered_lookup +# error "__cpp_lib_generic_unordered_lookup should not be defined before c++20" +# endif + +# ifdef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should not be defined before c++17" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_generic_unordered_lookup +# error "__cpp_lib_generic_unordered_lookup should not be defined before c++20" +# endif + +# ifdef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should not be defined before c++17" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_generic_unordered_lookup +# error "__cpp_lib_generic_unordered_lookup should not be defined before c++20" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++17" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++17" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++17" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined before c++23" +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++20" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++20" +# endif + +# ifndef __cpp_lib_generic_unordered_lookup +# error "__cpp_lib_generic_unordered_lookup should be defined in c++20" +# endif +# if __cpp_lib_generic_unordered_lookup != 201811L +# error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++20" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++20" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++20" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++23" +# endif +# if __cpp_lib_associative_heterogeneous_erasure != 202110L +# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++23" +# endif +# else +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined before c++26" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++23" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++23" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++23" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++23" +# endif + +# ifndef __cpp_lib_generic_unordered_lookup +# error "__cpp_lib_generic_unordered_lookup should be defined in c++23" +# endif +# if __cpp_lib_generic_unordered_lookup != 201811L +# error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++23" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++23" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++23" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++23" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should be defined in c++26" +# endif +# if __cpp_lib_associative_heterogeneous_erasure != 202110L +# error "__cpp_lib_associative_heterogeneous_erasure should have the value 202110L in c++26" +# endif +# else +# ifdef __cpp_lib_associative_heterogeneous_erasure +# error "__cpp_lib_associative_heterogeneous_erasure should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should be defined in c++26" +# endif +# if __cpp_lib_associative_heterogeneous_insertion != 202306L +# error "__cpp_lib_associative_heterogeneous_insertion should have the value 202306L in c++26" +# endif +# else +# ifdef __cpp_lib_associative_heterogeneous_insertion +# error "__cpp_lib_associative_heterogeneous_insertion should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++26" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++26" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++26" +# endif + +# ifndef __cpp_lib_generic_unordered_lookup +# error "__cpp_lib_generic_unordered_lookup should be defined in c++26" +# endif +# if __cpp_lib_generic_unordered_lookup != 201811L +# error "__cpp_lib_generic_unordered_lookup should have the value 201811L in c++26" +# endif + +# ifndef __cpp_lib_node_extract +# error "__cpp_lib_node_extract should be defined in c++26" +# endif +# if __cpp_lib_node_extract != 201606L +# error "__cpp_lib_node_extract should have the value 201606L in c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++26" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/utility.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/utility.version.compile.pass.cpp new file mode 100644 index 0000000000000..e0a83c7813b28 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/utility.version.compile.pass.cpp @@ -0,0 +1,495 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_as_const +# error "__cpp_lib_as_const should not be defined before c++17" +# endif + +# ifdef __cpp_lib_constexpr_algorithms +# error "__cpp_lib_constexpr_algorithms should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_utility +# error "__cpp_lib_constexpr_utility should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_exchange_function +# error "__cpp_lib_exchange_function should not be defined before c++14" +# endif + +# ifdef __cpp_lib_forward_like +# error "__cpp_lib_forward_like should not be defined before c++23" +# endif + +# ifdef __cpp_lib_integer_comparison_functions +# error "__cpp_lib_integer_comparison_functions should not be defined before c++20" +# endif + +# ifdef __cpp_lib_integer_sequence +# error "__cpp_lib_integer_sequence should not be defined before c++14" +# endif + +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined before c++23" +# endif + +# ifdef __cpp_lib_to_underlying +# error "__cpp_lib_to_underlying should not be defined before c++23" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +# ifdef __cpp_lib_tuples_by_type +# error "__cpp_lib_tuples_by_type should not be defined before c++14" +# endif + +# ifdef __cpp_lib_unreachable +# error "__cpp_lib_unreachable should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_as_const +# error "__cpp_lib_as_const should not be defined before c++17" +# endif + +# ifdef __cpp_lib_constexpr_algorithms +# error "__cpp_lib_constexpr_algorithms should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_utility +# error "__cpp_lib_constexpr_utility should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifndef __cpp_lib_exchange_function +# error "__cpp_lib_exchange_function should be defined in c++14" +# endif +# if __cpp_lib_exchange_function != 201304L +# error "__cpp_lib_exchange_function should have the value 201304L in c++14" +# endif + +# ifdef __cpp_lib_forward_like +# error "__cpp_lib_forward_like should not be defined before c++23" +# endif + +# ifdef __cpp_lib_integer_comparison_functions +# error "__cpp_lib_integer_comparison_functions should not be defined before c++20" +# endif + +# ifndef __cpp_lib_integer_sequence +# error "__cpp_lib_integer_sequence should be defined in c++14" +# endif +# if __cpp_lib_integer_sequence != 201304L +# error "__cpp_lib_integer_sequence should have the value 201304L in c++14" +# endif + +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined before c++23" +# endif + +# ifdef __cpp_lib_to_underlying +# error "__cpp_lib_to_underlying should not be defined before c++23" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +# ifndef __cpp_lib_tuples_by_type +# error "__cpp_lib_tuples_by_type should be defined in c++14" +# endif +# if __cpp_lib_tuples_by_type != 201304L +# error "__cpp_lib_tuples_by_type should have the value 201304L in c++14" +# endif + +# ifdef __cpp_lib_unreachable +# error "__cpp_lib_unreachable should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_as_const +# error "__cpp_lib_as_const should be defined in c++17" +# endif +# if __cpp_lib_as_const != 201510L +# error "__cpp_lib_as_const should have the value 201510L in c++17" +# endif + +# ifdef __cpp_lib_constexpr_algorithms +# error "__cpp_lib_constexpr_algorithms should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constexpr_utility +# error "__cpp_lib_constexpr_utility should not be defined before c++20" +# endif + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifndef __cpp_lib_exchange_function +# error "__cpp_lib_exchange_function should be defined in c++17" +# endif +# if __cpp_lib_exchange_function != 201304L +# error "__cpp_lib_exchange_function should have the value 201304L in c++17" +# endif + +# ifdef __cpp_lib_forward_like +# error "__cpp_lib_forward_like should not be defined before c++23" +# endif + +# ifdef __cpp_lib_integer_comparison_functions +# error "__cpp_lib_integer_comparison_functions should not be defined before c++20" +# endif + +# ifndef __cpp_lib_integer_sequence +# error "__cpp_lib_integer_sequence should be defined in c++17" +# endif +# if __cpp_lib_integer_sequence != 201304L +# error "__cpp_lib_integer_sequence should have the value 201304L in c++17" +# endif + +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined before c++23" +# endif + +# ifdef __cpp_lib_to_underlying +# error "__cpp_lib_to_underlying should not be defined before c++23" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +# ifndef __cpp_lib_tuples_by_type +# error "__cpp_lib_tuples_by_type should be defined in c++17" +# endif +# if __cpp_lib_tuples_by_type != 201304L +# error "__cpp_lib_tuples_by_type should have the value 201304L in c++17" +# endif + +# ifdef __cpp_lib_unreachable +# error "__cpp_lib_unreachable should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_as_const +# error "__cpp_lib_as_const should be defined in c++20" +# endif +# if __cpp_lib_as_const != 201510L +# error "__cpp_lib_as_const should have the value 201510L in c++20" +# endif + +# ifndef __cpp_lib_constexpr_algorithms +# error "__cpp_lib_constexpr_algorithms should be defined in c++20" +# endif +# if __cpp_lib_constexpr_algorithms != 201806L +# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++20" +# endif + +# ifndef __cpp_lib_constexpr_utility +# error "__cpp_lib_constexpr_utility should be defined in c++20" +# endif +# if __cpp_lib_constexpr_utility != 201811L +# error "__cpp_lib_constexpr_utility should have the value 201811L in c++20" +# endif + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifndef __cpp_lib_exchange_function +# error "__cpp_lib_exchange_function should be defined in c++20" +# endif +# if __cpp_lib_exchange_function != 201304L +# error "__cpp_lib_exchange_function should have the value 201304L in c++20" +# endif + +# ifdef __cpp_lib_forward_like +# error "__cpp_lib_forward_like should not be defined before c++23" +# endif + +# ifndef __cpp_lib_integer_comparison_functions +# error "__cpp_lib_integer_comparison_functions should be defined in c++20" +# endif +# if __cpp_lib_integer_comparison_functions != 202002L +# error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++20" +# endif + +# ifndef __cpp_lib_integer_sequence +# error "__cpp_lib_integer_sequence should be defined in c++20" +# endif +# if __cpp_lib_integer_sequence != 201304L +# error "__cpp_lib_integer_sequence should have the value 201304L in c++20" +# endif + +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined before c++23" +# endif + +# ifdef __cpp_lib_to_underlying +# error "__cpp_lib_to_underlying should not be defined before c++23" +# endif + +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined before c++23" +# endif + +# ifndef __cpp_lib_tuples_by_type +# error "__cpp_lib_tuples_by_type should be defined in c++20" +# endif +# if __cpp_lib_tuples_by_type != 201304L +# error "__cpp_lib_tuples_by_type should have the value 201304L in c++20" +# endif + +# ifdef __cpp_lib_unreachable +# error "__cpp_lib_unreachable should not be defined before c++23" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_as_const +# error "__cpp_lib_as_const should be defined in c++23" +# endif +# if __cpp_lib_as_const != 201510L +# error "__cpp_lib_as_const should have the value 201510L in c++23" +# endif + +# ifndef __cpp_lib_constexpr_algorithms +# error "__cpp_lib_constexpr_algorithms should be defined in c++23" +# endif +# if __cpp_lib_constexpr_algorithms != 201806L +# error "__cpp_lib_constexpr_algorithms should have the value 201806L in c++23" +# endif + +# ifndef __cpp_lib_constexpr_utility +# error "__cpp_lib_constexpr_utility should be defined in c++23" +# endif +# if __cpp_lib_constexpr_utility != 201811L +# error "__cpp_lib_constexpr_utility should have the value 201811L in c++23" +# endif + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifndef __cpp_lib_exchange_function +# error "__cpp_lib_exchange_function should be defined in c++23" +# endif +# if __cpp_lib_exchange_function != 201304L +# error "__cpp_lib_exchange_function should have the value 201304L in c++23" +# endif + +# ifndef __cpp_lib_forward_like +# error "__cpp_lib_forward_like should be defined in c++23" +# endif +# if __cpp_lib_forward_like != 202207L +# error "__cpp_lib_forward_like should have the value 202207L in c++23" +# endif + +# ifndef __cpp_lib_integer_comparison_functions +# error "__cpp_lib_integer_comparison_functions should be defined in c++23" +# endif +# if __cpp_lib_integer_comparison_functions != 202002L +# error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++23" +# endif + +# ifndef __cpp_lib_integer_sequence +# error "__cpp_lib_integer_sequence should be defined in c++23" +# endif +# if __cpp_lib_integer_sequence != 201304L +# error "__cpp_lib_integer_sequence should have the value 201304L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should be defined in c++23" +# endif +# if __cpp_lib_ranges_zip != 202110L +# error "__cpp_lib_ranges_zip should have the value 202110L in c++23" +# endif +# else +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_to_underlying +# error "__cpp_lib_to_underlying should be defined in c++23" +# endif +# if __cpp_lib_to_underlying != 202102L +# error "__cpp_lib_to_underlying should have the value 202102L in c++23" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should be defined in c++23" +# endif +# if __cpp_lib_tuple_like != 202207L +# error "__cpp_lib_tuple_like should have the value 202207L in c++23" +# endif +# else +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_tuples_by_type +# error "__cpp_lib_tuples_by_type should be defined in c++23" +# endif +# if __cpp_lib_tuples_by_type != 201304L +# error "__cpp_lib_tuples_by_type should have the value 201304L in c++23" +# endif + +# ifndef __cpp_lib_unreachable +# error "__cpp_lib_unreachable should be defined in c++23" +# endif +# if __cpp_lib_unreachable != 202202L +# error "__cpp_lib_unreachable should have the value 202202L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_as_const +# error "__cpp_lib_as_const should be defined in c++26" +# endif +# if __cpp_lib_as_const != 201510L +# error "__cpp_lib_as_const should have the value 201510L in c++26" +# endif + +# ifndef __cpp_lib_constexpr_algorithms +# error "__cpp_lib_constexpr_algorithms should be defined in c++26" +# endif +# if __cpp_lib_constexpr_algorithms != 202306L +# error "__cpp_lib_constexpr_algorithms should have the value 202306L in c++26" +# endif + +# ifndef __cpp_lib_constexpr_utility +# error "__cpp_lib_constexpr_utility should be defined in c++26" +# endif +# if __cpp_lib_constexpr_utility != 201811L +# error "__cpp_lib_constexpr_utility should have the value 201811L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should be defined in c++26" +# endif +# if __cpp_lib_constrained_equality != 202403L +# error "__cpp_lib_constrained_equality should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_exchange_function +# error "__cpp_lib_exchange_function should be defined in c++26" +# endif +# if __cpp_lib_exchange_function != 201304L +# error "__cpp_lib_exchange_function should have the value 201304L in c++26" +# endif + +# ifndef __cpp_lib_forward_like +# error "__cpp_lib_forward_like should be defined in c++26" +# endif +# if __cpp_lib_forward_like != 202207L +# error "__cpp_lib_forward_like should have the value 202207L in c++26" +# endif + +# ifndef __cpp_lib_integer_comparison_functions +# error "__cpp_lib_integer_comparison_functions should be defined in c++26" +# endif +# if __cpp_lib_integer_comparison_functions != 202002L +# error "__cpp_lib_integer_comparison_functions should have the value 202002L in c++26" +# endif + +# ifndef __cpp_lib_integer_sequence +# error "__cpp_lib_integer_sequence should be defined in c++26" +# endif +# if __cpp_lib_integer_sequence != 201304L +# error "__cpp_lib_integer_sequence should have the value 201304L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should be defined in c++26" +# endif +# if __cpp_lib_ranges_zip != 202110L +# error "__cpp_lib_ranges_zip should have the value 202110L in c++26" +# endif +# else +# ifdef __cpp_lib_ranges_zip +# error "__cpp_lib_ranges_zip should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_to_underlying +# error "__cpp_lib_to_underlying should be defined in c++26" +# endif +# if __cpp_lib_to_underlying != 202102L +# error "__cpp_lib_to_underlying should have the value 202102L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should be defined in c++26" +# endif +# if __cpp_lib_tuple_like != 202311L +# error "__cpp_lib_tuple_like should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_tuple_like +# error "__cpp_lib_tuple_like should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_tuples_by_type +# error "__cpp_lib_tuples_by_type should be defined in c++26" +# endif +# if __cpp_lib_tuples_by_type != 201304L +# error "__cpp_lib_tuples_by_type should have the value 201304L in c++26" +# endif + +# ifndef __cpp_lib_unreachable +# error "__cpp_lib_unreachable should be defined in c++26" +# endif +# if __cpp_lib_unreachable != 202202L +# error "__cpp_lib_unreachable should have the value 202202L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/variant.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/variant.version.compile.pass.cpp new file mode 100644 index 0000000000000..dc4af4d09f9e5 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/variant.version.compile.pass.cpp @@ -0,0 +1,138 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_variant +# error "__cpp_lib_freestanding_variant should not be defined before c++26" +# endif + +# ifdef __cpp_lib_variant +# error "__cpp_lib_variant should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_variant +# error "__cpp_lib_freestanding_variant should not be defined before c++26" +# endif + +# ifdef __cpp_lib_variant +# error "__cpp_lib_variant should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_variant +# error "__cpp_lib_freestanding_variant should not be defined before c++26" +# endif + +# ifndef __cpp_lib_variant +# error "__cpp_lib_variant should be defined in c++17" +# endif +# if __cpp_lib_variant != 202102L +# error "__cpp_lib_variant should have the value 202102L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_variant +# error "__cpp_lib_freestanding_variant should not be defined before c++26" +# endif + +# ifndef __cpp_lib_variant +# error "__cpp_lib_variant should be defined in c++20" +# endif +# if __cpp_lib_variant != 202106L +# error "__cpp_lib_variant should have the value 202106L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined before c++26" +# endif + +# ifdef __cpp_lib_freestanding_variant +# error "__cpp_lib_freestanding_variant should not be defined before c++26" +# endif + +# ifndef __cpp_lib_variant +# error "__cpp_lib_variant should be defined in c++23" +# endif +# if __cpp_lib_variant != 202106L +# error "__cpp_lib_variant should have the value 202106L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should be defined in c++26" +# endif +# if __cpp_lib_constrained_equality != 202403L +# error "__cpp_lib_constrained_equality should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_constrained_equality +# error "__cpp_lib_constrained_equality should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_freestanding_variant +# error "__cpp_lib_freestanding_variant should be defined in c++26" +# endif +# if __cpp_lib_freestanding_variant != 202311L +# error "__cpp_lib_freestanding_variant should have the value 202311L in c++26" +# endif +# else +# ifdef __cpp_lib_freestanding_variant +# error "__cpp_lib_freestanding_variant should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_variant +# error "__cpp_lib_variant should be defined in c++26" +# endif +# if __cpp_lib_variant != 202306L +# error "__cpp_lib_variant should have the value 202306L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/test/std/language.support/support.limits/support.limits.general/v2/vector.version.compile.pass.cpp b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/vector.version.compile.pass.cpp new file mode 100644 index 0000000000000..c2513ecad8d08 --- /dev/null +++ b/libcxx/test/std/language.support/support.limits/support.limits.general/v2/vector.version.compile.pass.cpp @@ -0,0 +1,273 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by generate_feature_test_macro_components.py +// and should not be edited manually. + +// + +// Test the feature test macros defined by + +// clang-format off + +#include +#include "test_macros.h" + +#if TEST_STD_VER < 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_constexpr_vector +# error "__cpp_lib_constexpr_vector should not be defined before c++20" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should not be defined before c++17" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 14 + +# ifdef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17" +# endif + +# ifdef __cpp_lib_constexpr_vector +# error "__cpp_lib_constexpr_vector should not be defined before c++20" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifdef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should not be defined before c++17" +# endif + +# ifdef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should not be defined before c++17" +# endif + +#elif TEST_STD_VER == 17 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17" +# endif + +# ifdef __cpp_lib_constexpr_vector +# error "__cpp_lib_constexpr_vector should not be defined before c++20" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifdef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should not be defined before c++20" +# endif + +# ifndef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should be defined in c++17" +# endif +# if __cpp_lib_incomplete_container_elements != 201505L +# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++17" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17" +# endif + +#elif TEST_STD_VER == 20 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++20" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++20" +# endif + +# ifndef __cpp_lib_constexpr_vector +# error "__cpp_lib_constexpr_vector should be defined in c++20" +# endif +# if __cpp_lib_constexpr_vector != 201907L +# error "__cpp_lib_constexpr_vector should have the value 201907L in c++20" +# endif + +# ifdef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should not be defined before c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++20" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++20" +# endif + +# ifndef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should be defined in c++20" +# endif +# if __cpp_lib_incomplete_container_elements != 201505L +# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++20" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++20" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++20" +# endif + +#elif TEST_STD_VER == 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++23" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++23" +# endif + +# ifndef __cpp_lib_constexpr_vector +# error "__cpp_lib_constexpr_vector should be defined in c++23" +# endif +# if __cpp_lib_constexpr_vector != 201907L +# error "__cpp_lib_constexpr_vector should have the value 201907L in c++23" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++23" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++23" +# endif + +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined before c++26" +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++23" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++23" +# endif + +# ifndef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should be defined in c++23" +# endif +# if __cpp_lib_incomplete_container_elements != 201505L +# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++23" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++23" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++23" +# endif + +#elif TEST_STD_VER > 23 + +# ifndef __cpp_lib_allocator_traits_is_always_equal +# error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++26" +# endif +# if __cpp_lib_allocator_traits_is_always_equal != 201411L +# error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++26" +# endif + +# ifndef __cpp_lib_constexpr_vector +# error "__cpp_lib_constexpr_vector should be defined in c++26" +# endif +# if __cpp_lib_constexpr_vector != 201907L +# error "__cpp_lib_constexpr_vector should have the value 201907L in c++26" +# endif + +# ifndef __cpp_lib_containers_ranges +# error "__cpp_lib_containers_ranges should be defined in c++26" +# endif +# if __cpp_lib_containers_ranges != 202202L +# error "__cpp_lib_containers_ranges should have the value 202202L in c++26" +# endif + +# if !defined(_LIBCPP_VERSION) +# ifndef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should be defined in c++26" +# endif +# if __cpp_lib_default_template_type_for_algorithm_values != 202403L +# error "__cpp_lib_default_template_type_for_algorithm_values should have the value 202403L in c++26" +# endif +# else +# ifdef __cpp_lib_default_template_type_for_algorithm_values +# error "__cpp_lib_default_template_type_for_algorithm_values should not be defined because it is unimplemented in libc++!" +# endif +# endif + +# ifndef __cpp_lib_erase_if +# error "__cpp_lib_erase_if should be defined in c++26" +# endif +# if __cpp_lib_erase_if != 202002L +# error "__cpp_lib_erase_if should have the value 202002L in c++26" +# endif + +# ifndef __cpp_lib_incomplete_container_elements +# error "__cpp_lib_incomplete_container_elements should be defined in c++26" +# endif +# if __cpp_lib_incomplete_container_elements != 201505L +# error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++26" +# endif + +# ifndef __cpp_lib_nonmember_container_access +# error "__cpp_lib_nonmember_container_access should be defined in c++26" +# endif +# if __cpp_lib_nonmember_container_access != 201411L +# error "__cpp_lib_nonmember_container_access should have the value 201411L in c++26" +# endif + +#endif // TEST_STD_VER > 23 + +// clang-format on + diff --git a/libcxx/utils/data/feature_test_macro/data.json b/libcxx/utils/data/feature_test_macro/data.json new file mode 100644 index 0000000000000..28ca43d22fe2c --- /dev/null +++ b/libcxx/utils/data/feature_test_macro/data.json @@ -0,0 +1,3000 @@ +[ + { + "name": "__cpp_lib_adaptor_iterator_pair_constructor", + "values": { + "c++23": { + "202106": [ + { + "implemented": true + } + ] + } + }, + "headers": ["queue", "stack"] + }, + { + "name": "__cpp_lib_addressof_constexpr", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_allocate_at_least", + "values": { + "c++23": { + "202302": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_allocator_traits_is_always_equal", + "values": { + "c++17": { + "201411": [ + { + "implemented": true + } + ] + } + }, + "headers": ["deque", "forward_list", "list", "map", "memory", "scoped_allocator", "set", "string", "unordered_map", "unordered_set", "vector"] + }, + { + "name": "__cpp_lib_any", + "values": { + "c++17": { + "201606": [ + { + "implemented": true + } + ] + } + }, + "headers": ["any"] + }, + { + "name": "__cpp_lib_apply", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + } + }, + "headers": ["tuple"] + }, + { + "name": "__cpp_lib_array_constexpr", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + }, + "c++20": { + "201811": [ + { + "implemented": true + } + ] + } + }, + "headers": ["array", "iterator"] + }, + { + "name": "__cpp_lib_as_const", + "values": { + "c++17": { + "201510": [ + { + "implemented": true + } + ] + } + }, + "headers": ["utility"] + }, + { + "name": "__cpp_lib_associative_heterogeneous_erasure", + "values": { + "c++23": { + "202110": [ + { + "implemented": false + } + ] + } + }, + "headers": ["map", "set", "unordered_map", "unordered_set"] + }, + { + "name": "__cpp_lib_associative_heterogeneous_insertion", + "values": { + "c++26": { + "202306": [ + { + "implemented": false + } + ] + } + }, + "headers": ["map", "set", "unordered_map", "unordered_set"] + }, + { + "name": "__cpp_lib_assume_aligned", + "values": { + "c++20": { + "201811": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_atomic_flag_test", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["atomic"] + }, + { + "name": "__cpp_lib_atomic_float", + "values": { + "c++20": { + "201711": [ + { + "implemented": true + } + ] + } + }, + "headers": ["atomic"] + }, + { + "name": "__cpp_lib_atomic_is_always_lock_free", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + } + }, + "headers": ["atomic"] + }, + { + "name": "__cpp_lib_atomic_lock_free_type_aliases", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["atomic"] + }, + { + "name": "__cpp_lib_atomic_min_max", + "values": { + "c++26": { + "202403": [ + { + "implemented": false + } + ] + } + }, + "headers": ["atomic"] + }, + { + "name": "__cpp_lib_atomic_ref", + "values": { + "c++20": { + "201806": [ + { + "implemented": true + } + ] + } + }, + "headers": ["atomic"] + }, + { + "name": "__cpp_lib_atomic_shared_ptr", + "values": { + "c++20": { + "201711": [ + { + "implemented": false + } + ] + } + }, + "headers": ["atomic"] + }, + { + "name": "__cpp_lib_atomic_value_initialization", + "values": { + "c++20": { + "201911": [ + { + "implemented": true + } + ] + } + }, + "headers": ["atomic", "memory"] + }, + { + "name": "__cpp_lib_atomic_wait", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["atomic"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_SYNC", + "libcxx_guard": "_LIBCPP_AVAILABILITY_HAS_SYNC" + }, + { + "name": "__cpp_lib_barrier", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["barrier"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)", + "libcxx_guard": "_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC" + }, + { + "name": "__cpp_lib_bind_back", + "values": { + "c++23": { + "202202": [ + { + "implemented": true + } + ] + } + }, + "headers": ["functional"] + }, + { + "name": "__cpp_lib_bind_front", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + }, + "c++26": { + "202306": [ + { + "implemented": true + } + ] + } + }, + "headers": ["functional"] + }, + { + "name": "__cpp_lib_bit_cast", + "values": { + "c++20": { + "201806": [ + { + "implemented": true + } + ] + } + }, + "headers": ["bit"] + }, + { + "name": "__cpp_lib_bitops", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["bit"] + }, + { + "name": "__cpp_lib_bitset", + "values": { + "c++26": { + "202306": [ + { + "implemented": true + } + ] + } + }, + "headers": ["bitset"] + }, + { + "name": "__cpp_lib_bool_constant", + "values": { + "c++17": { + "201505": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_bounded_array_traits", + "values": { + "c++20": { + "201902": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_boyer_moore_searcher", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + } + }, + "headers": ["functional"] + }, + { + "name": "__cpp_lib_byte", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + } + }, + "headers": ["cstddef"] + }, + { + "name": "__cpp_lib_byteswap", + "values": { + "c++23": { + "202110": [ + { + "implemented": true + } + ] + } + }, + "headers": ["bit"] + }, + { + "name": "__cpp_lib_char8_t", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["atomic", "filesystem", "istream", "limits", "locale", "ostream", "string", "string_view"], + "test_suite_guard": "defined(__cpp_char8_t)", + "libcxx_guard": "_LIBCPP_HAS_CHAR8_T" + }, + { + "name": "__cpp_lib_chrono", + "values": { + "c++17": { + "201611": [ + { + "implemented": true + } + ] + } + }, + "headers": ["chrono"] + }, + { + "name": "__cpp_lib_chrono_udls", + "values": { + "c++14": { + "201304": [ + { + "implemented": true + } + ] + } + }, + "headers": ["chrono"] + }, + { + "name": "__cpp_lib_clamp", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + } + }, + "headers": ["algorithm"] + }, + { + "name": "__cpp_lib_complex_udls", + "values": { + "c++14": { + "201309": [ + { + "implemented": true + } + ] + } + }, + "headers": ["complex"] + }, + { + "name": "__cpp_lib_concepts", + "values": { + "c++20": { + "202002": [ + { + "implemented": true + } + ] + } + }, + "headers": ["concepts"] + }, + { + "name": "__cpp_lib_constexpr_algorithms", + "values": { + "c++20": { + "201806": [ + { + "implemented": true + } + ] + }, + "c++26": { + "202306": [ + { + "implemented": true + } + ] + } + }, + "headers": ["algorithm", "utility"] + }, + { + "name": "__cpp_lib_constexpr_bitset", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["bitset"] + }, + { + "name": "__cpp_lib_constexpr_charconv", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["charconv"] + }, + { + "name": "__cpp_lib_constexpr_cmath", + "values": { + "c++23": { + "202202": [ + { + "implemented": false + } + ] + } + }, + "headers": ["cmath", "cstdlib"] + }, + { + "name": "__cpp_lib_constexpr_complex", + "values": { + "c++20": { + "201711": [ + { + "implemented": true + } + ] + } + }, + "headers": ["complex"] + }, + { + "name": "__cpp_lib_constexpr_dynamic_alloc", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_constexpr_functional", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["functional"] + }, + { + "name": "__cpp_lib_constexpr_iterator", + "values": { + "c++20": { + "201811": [ + { + "implemented": true + } + ] + } + }, + "headers": ["iterator"] + }, + { + "name": "__cpp_lib_constexpr_memory", + "values": { + "c++20": { + "201811": [ + { + "implemented": true + } + ] + }, + "c++23": { + "202202": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_constexpr_new", + "values": { + "c++26": { + "202406": [ + { + "implemented": true + } + ] + } + }, + "headers": ["new"], + "test_suite_guard": "!defined(_LIBCPP_ABI_VCRUNTIME)", + "libcxx_guard": "!defined(_LIBCPP_ABI_VCRUNTIME)" + }, + { + "name": "__cpp_lib_constexpr_numeric", + "values": { + "c++20": { + "201911": [ + { + "implemented": true + } + ] + } + }, + "headers": ["numeric"] + }, + { + "name": "__cpp_lib_constexpr_string", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["string"] + }, + { + "name": "__cpp_lib_constexpr_string_view", + "values": { + "c++20": { + "201811": [ + { + "implemented": true + } + ] + } + }, + "headers": ["string_view"] + }, + { + "name": "__cpp_lib_constexpr_tuple", + "values": { + "c++20": { + "201811": [ + { + "implemented": true + } + ] + } + }, + "headers": ["tuple"] + }, + { + "name": "__cpp_lib_constexpr_typeinfo", + "values": { + "c++23": { + "202106": [ + { + "implemented": true + } + ] + } + }, + "headers": ["typeinfo"] + }, + { + "name": "__cpp_lib_constexpr_utility", + "values": { + "c++20": { + "201811": [ + { + "implemented": true + } + ] + } + }, + "headers": ["utility"] + }, + { + "name": "__cpp_lib_constexpr_vector", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["vector"] + }, + { + "name": "__cpp_lib_constrained_equality", + "values": { + "c++26": { + "202403": [ + { + "implemented": false + } + ] + } + }, + "headers": ["optional", "tuple", "utility", "variant"] + }, + { + "name": "__cpp_lib_containers_ranges", + "values": { + "c++23": { + "202202": [ + { + "implemented": true + } + ] + } + }, + "headers": ["deque", "forward_list", "list", "map", "queue", "set", "stack", "string", "unordered_map", "unordered_set", "vector"] + }, + { + "name": "__cpp_lib_copyable_function", + "values": { + "c++26": { + "202306": [ + { + "implemented": false + } + ] + } + }, + "headers": ["functional"] + }, + { + "name": "__cpp_lib_coroutine", + "values": { + "c++20": { + "201902": [ + { + "implemented": true + } + ] + } + }, + "headers": ["coroutine"] + }, + { + "name": "__cpp_lib_debugging", + "values": { + "c++26": { + "202311": [ + { + "implemented": false + } + ] + } + }, + "headers": ["debugging"] + }, + { + "name": "__cpp_lib_default_template_type_for_algorithm_values", + "values": { + "c++26": { + "202403": [ + { + "implemented": false + } + ] + } + }, + "headers": ["algorithm", "deque", "forward_list", "list", "ranges", "string", "vector"] + }, + { + "name": "__cpp_lib_destroying_delete", + "values": { + "c++20": { + "201806": [ + { + "implemented": true + } + ] + } + }, + "headers": ["new"], + "test_suite_guard": "TEST_STD_VER > 17 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L", + "libcxx_guard": "_LIBCPP_STD_VER >= 20 && defined(__cpp_impl_destroying_delete) && __cpp_impl_destroying_delete >= 201806L" + }, + { + "name": "__cpp_lib_enable_shared_from_this", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_endian", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["bit"] + }, + { + "name": "__cpp_lib_erase_if", + "values": { + "c++20": { + "202002": [ + { + "implemented": true + } + ] + } + }, + "headers": ["deque", "forward_list", "list", "map", "set", "string", "unordered_map", "unordered_set", "vector"] + }, + { + "name": "__cpp_lib_exchange_function", + "values": { + "c++14": { + "201304": [ + { + "implemented": true + } + ] + } + }, + "headers": ["utility"] + }, + { + "name": "__cpp_lib_execution", + "values": { + "c++17": { + "201603": [ + { + "implemented": false + } + ] + }, + "c++20": { + "201902": [ + { + "implemented": false + } + ] + } + }, + "headers": ["execution"] + }, + { + "name": "__cpp_lib_expected", + "values": { + "c++23": { + "202211": [ + { + "implemented": true + } + ] + } + }, + "headers": ["expected"] + }, + { + "name": "__cpp_lib_filesystem", + "values": { + "c++17": { + "201703": [ + { + "implemented": true + } + ] + } + }, + "headers": ["filesystem"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)", + "libcxx_guard": "_LIBCPP_HAS_FILESYSTEM && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY" + }, + { + "name": "__cpp_lib_flat_map", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["flat_map"] + }, + { + "name": "__cpp_lib_flat_set", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["flat_set"] + }, + { + "name": "__cpp_lib_format", + "values": { + "c++20": { + "202110": [ + { + "implemented": true + } + ] + } + }, + "headers": ["format"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT", + "libcxx_guard": "_LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT" + }, + { + "name": "__cpp_lib_format_path", + "values": { + "c++26": { + "202403": [ + { + "implemented": false + } + ] + } + }, + "headers": ["filesystem"] + }, + { + "name": "__cpp_lib_format_ranges", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["format"] + }, + { + "name": "__cpp_lib_format_uchar", + "values": { + "c++20": { + "202311": [ + { + "implemented": true + } + ] + } + }, + "headers": ["format"] + }, + { + "name": "__cpp_lib_formatters", + "values": { + "c++23": { + "202302": [ + { + "implemented": false + } + ] + } + }, + "headers": ["stacktrace", "thread"] + }, + { + "name": "__cpp_lib_forward_like", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["utility"] + }, + { + "name": "__cpp_lib_freestanding_algorithm", + "values": { + "c++26": { + "202311": [ + { + "implemented": false + } + ] + } + }, + "headers": ["algorithm"] + }, + { + "name": "__cpp_lib_freestanding_array", + "values": { + "c++26": { + "202311": [ + { + "implemented": false + } + ] + } + }, + "headers": ["array"] + }, + { + "name": "__cpp_lib_freestanding_cstring", + "values": { + "c++26": { + "202306": [ + { + "implemented": false + } + ] + } + }, + "headers": ["cstring"] + }, + { + "name": "__cpp_lib_freestanding_expected", + "values": { + "c++26": { + "202311": [ + { + "implemented": false + } + ] + } + }, + "headers": ["expected"] + }, + { + "name": "__cpp_lib_freestanding_mdspan", + "values": { + "c++26": { + "202311": [ + { + "implemented": false + } + ] + } + }, + "headers": ["mdspan"] + }, + { + "name": "__cpp_lib_freestanding_optional", + "values": { + "c++26": { + "202311": [ + { + "implemented": false + } + ] + } + }, + "headers": ["optional"] + }, + { + "name": "__cpp_lib_freestanding_string_view", + "values": { + "c++26": { + "202311": [ + { + "implemented": false + } + ] + } + }, + "headers": ["string_view"] + }, + { + "name": "__cpp_lib_freestanding_variant", + "values": { + "c++26": { + "202311": [ + { + "implemented": false + } + ] + } + }, + "headers": ["variant"] + }, + { + "name": "__cpp_lib_fstream_native_handle", + "values": { + "c++26": { + "202306": [ + { + "implemented": true + } + ] + } + }, + "headers": ["fstream"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)", + "libcxx_guard": "_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION" + }, + { + "name": "__cpp_lib_function_ref", + "values": { + "c++26": { + "202306": [ + { + "implemented": false + } + ] + } + }, + "headers": ["functional"] + }, + { + "name": "__cpp_lib_gcd_lcm", + "values": { + "c++17": { + "201606": [ + { + "implemented": true + } + ] + } + }, + "headers": ["numeric"] + }, + { + "name": "__cpp_lib_generate_random", + "values": { + "c++26": { + "202403": [ + { + "implemented": false + } + ] + } + }, + "headers": ["random"] + }, + { + "name": "__cpp_lib_generic_associative_lookup", + "values": { + "c++14": { + "201304": [ + { + "implemented": true + } + ] + } + }, + "headers": ["map", "set"] + }, + { + "name": "__cpp_lib_generic_unordered_lookup", + "values": { + "c++20": { + "201811": [ + { + "implemented": true + } + ] + } + }, + "headers": ["unordered_map", "unordered_set"] + }, + { + "name": "__cpp_lib_hardware_interference_size", + "values": { + "c++17": { + "201703": [ + { + "implemented": true + } + ] + } + }, + "headers": ["new"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || (defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE))", + "libcxx_guard": "defined(__GCC_DESTRUCTIVE_SIZE) && defined(__GCC_CONSTRUCTIVE_SIZE)" + }, + { + "name": "__cpp_lib_has_unique_object_representations", + "values": { + "c++17": { + "201606": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_hazard_pointer", + "values": { + "c++26": { + "202306": [ + { + "implemented": false + } + ] + } + }, + "headers": ["hazard_pointer"] + }, + { + "name": "__cpp_lib_hypot", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + } + }, + "headers": ["cmath"] + }, + { + "name": "__cpp_lib_incomplete_container_elements", + "values": { + "c++17": { + "201505": [ + { + "implemented": true + } + ] + } + }, + "headers": ["forward_list", "list", "vector"] + }, + { + "name": "__cpp_lib_inplace_vector", + "values": { + "c++26": { + "202406": [ + { + "implemented": false + } + ] + } + }, + "headers": ["inplace_vector"] + }, + { + "name": "__cpp_lib_int_pow2", + "values": { + "c++20": { + "202002": [ + { + "implemented": true + } + ] + } + }, + "headers": ["bit"] + }, + { + "name": "__cpp_lib_integer_comparison_functions", + "values": { + "c++20": { + "202002": [ + { + "implemented": true + } + ] + } + }, + "headers": ["utility"] + }, + { + "name": "__cpp_lib_integer_sequence", + "values": { + "c++14": { + "201304": [ + { + "implemented": true + } + ] + } + }, + "headers": ["utility"] + }, + { + "name": "__cpp_lib_integral_constant_callable", + "values": { + "c++14": { + "201304": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_interpolate", + "values": { + "c++20": { + "201902": [ + { + "implemented": true + } + ] + } + }, + "headers": ["cmath", "numeric"] + }, + { + "name": "__cpp_lib_invoke", + "values": { + "c++17": { + "201411": [ + { + "implemented": true + } + ] + } + }, + "headers": ["functional"] + }, + { + "name": "__cpp_lib_invoke_r", + "values": { + "c++23": { + "202106": [ + { + "implemented": true + } + ] + } + }, + "headers": ["functional"] + }, + { + "name": "__cpp_lib_ios_noreplace", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["ios"] + }, + { + "name": "__cpp_lib_is_aggregate", + "values": { + "c++17": { + "201703": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_is_constant_evaluated", + "values": { + "c++20": { + "201811": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_is_final", + "values": { + "c++14": { + "201402": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_is_implicit_lifetime", + "values": { + "c++23": { + "202302": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"], + "test_suite_guard": "__has_builtin(__builtin_is_implicit_lifetime)", + "libcxx_guard": "__has_builtin(__builtin_is_implicit_lifetime)" + }, + { + "name": "__cpp_lib_is_invocable", + "values": { + "c++17": { + "201703": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_is_layout_compatible", + "values": { + "c++20": { + "201907": [ + { + "implemented": false + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_is_nothrow_convertible", + "values": { + "c++20": { + "201806": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_is_null_pointer", + "values": { + "c++14": { + "201309": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_is_pointer_interconvertible", + "values": { + "c++20": { + "201907": [ + { + "implemented": false + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_is_scoped_enum", + "values": { + "c++23": { + "202011": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_is_swappable", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_is_virtual_base_of", + "values": { + "c++26": { + "202406": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"], + "test_suite_guard": "__has_builtin(__builtin_is_virtual_base_of)", + "libcxx_guard": "__has_builtin(__builtin_is_virtual_base_of)" + }, + { + "name": "__cpp_lib_is_within_lifetime", + "values": { + "c++26": { + "202306": [ + { + "implemented": false + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_jthread", + "values": { + "c++20": { + "201911": [ + { + "implemented": true + } + ] + } + }, + "headers": ["stop_token", "thread"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)", + "libcxx_guard": "_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC" + }, + { + "name": "__cpp_lib_latch", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["latch"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)", + "libcxx_guard": "_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC" + }, + { + "name": "__cpp_lib_launder", + "values": { + "c++17": { + "201606": [ + { + "implemented": true + } + ] + } + }, + "headers": ["new"] + }, + { + "name": "__cpp_lib_linalg", + "values": { + "c++26": { + "202311": [ + { + "implemented": false + } + ] + } + }, + "headers": ["linalg"] + }, + { + "name": "__cpp_lib_list_remove_return_type", + "values": { + "c++20": { + "201806": [ + { + "implemented": true + } + ] + } + }, + "headers": ["forward_list", "list"] + }, + { + "name": "__cpp_lib_logical_traits", + "values": { + "c++17": { + "201510": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_make_from_tuple", + "values": { + "c++17": { + "201606": [ + { + "implemented": true + } + ] + } + }, + "headers": ["tuple"] + }, + { + "name": "__cpp_lib_make_reverse_iterator", + "values": { + "c++14": { + "201402": [ + { + "implemented": true + } + ] + } + }, + "headers": ["iterator"] + }, + { + "name": "__cpp_lib_make_unique", + "values": { + "c++14": { + "201304": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_map_try_emplace", + "values": { + "c++17": { + "201411": [ + { + "implemented": true + } + ] + } + }, + "headers": ["map"] + }, + { + "name": "__cpp_lib_math_constants", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["numbers"] + }, + { + "name": "__cpp_lib_math_special_functions", + "values": { + "c++17": { + "201603": [ + { + "implemented": false + } + ] + } + }, + "headers": ["cmath"] + }, + { + "name": "__cpp_lib_mdspan", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + }, + "c++26": { + "202406": [ + { + "implemented": true + } + ] + } + }, + "headers": ["mdspan"] + }, + { + "name": "__cpp_lib_memory_resource", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory_resource"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR", + "libcxx_guard": "_LIBCPP_AVAILABILITY_HAS_PMR" + }, + { + "name": "__cpp_lib_modules", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": [] + }, + { + "name": "__cpp_lib_move_iterator_concept", + "values": { + "c++20": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["iterator"] + }, + { + "name": "__cpp_lib_move_only_function", + "values": { + "c++23": { + "202110": [ + { + "implemented": false + } + ] + } + }, + "headers": ["functional"] + }, + { + "name": "__cpp_lib_node_extract", + "values": { + "c++17": { + "201606": [ + { + "implemented": true + } + ] + } + }, + "headers": ["map", "set", "unordered_map", "unordered_set"] + }, + { + "name": "__cpp_lib_nonmember_container_access", + "values": { + "c++17": { + "201411": [ + { + "implemented": true + } + ] + } + }, + "headers": ["array", "deque", "forward_list", "iterator", "list", "map", "regex", "set", "string", "unordered_map", "unordered_set", "vector"] + }, + { + "name": "__cpp_lib_not_fn", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + }, + "c++26": { + "202306": [ + { + "implemented": true + } + ] + } + }, + "headers": ["functional"] + }, + { + "name": "__cpp_lib_null_iterators", + "values": { + "c++14": { + "201304": [ + { + "implemented": true + } + ] + } + }, + "headers": ["iterator"] + }, + { + "name": "__cpp_lib_optional", + "values": { + "c++17": { + "201606": [ + { + "implemented": true + } + ] + }, + "c++20": { + "202106": [ + { + "implemented": true + } + ] + }, + "c++23": { + "202110": [ + { + "implemented": true + } + ] + } + }, + "headers": ["optional"] + }, + { + "name": "__cpp_lib_optional_range_support", + "values": { + "c++26": { + "202406": [ + { + "implemented": false + } + ] + } + }, + "headers": ["optional"] + }, + { + "name": "__cpp_lib_out_ptr", + "values": { + "c++23": { + "202106": [ + { + "implemented": true + } + ] + }, + "c++26": { + "202311": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_parallel_algorithm", + "values": { + "c++17": { + "201603": [ + { + "implemented": false + } + ] + } + }, + "headers": ["algorithm", "numeric"] + }, + { + "name": "__cpp_lib_philox_engine", + "values": { + "c++26": { + "202406": [ + { + "implemented": false + } + ] + } + }, + "headers": ["random"] + }, + { + "name": "__cpp_lib_polymorphic_allocator", + "values": { + "c++20": { + "201902": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory_resource"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_PMR", + "libcxx_guard": "_LIBCPP_AVAILABILITY_HAS_PMR" + }, + { + "name": "__cpp_lib_print", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["ostream", "print"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT", + "libcxx_guard": "_LIBCPP_AVAILABILITY_HAS_TO_CHARS_FLOATING_POINT" + }, + { + "name": "__cpp_lib_quoted_string_io", + "values": { + "c++14": { + "201304": [ + { + "implemented": true + } + ] + } + }, + "headers": ["iomanip"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_LOCALIZATION", + "libcxx_guard": "_LIBCPP_HAS_LOCALIZATION" + }, + { + "name": "__cpp_lib_ranges", + "values": { + "c++20": { + "202110": [ + { + "implemented": true + } + ] + }, + "c++23": { + "202406": [ + { + "implemented": true + } + ] + } + }, + "headers": ["algorithm", "functional", "iterator", "memory", "ranges"] + }, + { + "name": "__cpp_lib_ranges_as_const", + "values": { + "c++23": { + "202207": [ + { + "implemented": false + } + ] + } + }, + "headers": ["ranges"] + }, + { + "name": "__cpp_lib_ranges_as_rvalue", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["ranges"] + }, + { + "name": "__cpp_lib_ranges_chunk", + "values": { + "c++23": { + "202202": [ + { + "implemented": false + } + ] + } + }, + "headers": ["ranges"] + }, + { + "name": "__cpp_lib_ranges_chunk_by", + "values": { + "c++23": { + "202202": [ + { + "implemented": true + } + ] + } + }, + "headers": ["ranges"] + }, + { + "name": "__cpp_lib_ranges_concat", + "values": { + "c++26": { + "202403": [ + { + "implemented": false + } + ] + } + }, + "headers": ["ranges"] + }, + { + "name": "__cpp_lib_ranges_contains", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["algorithm"] + }, + { + "name": "__cpp_lib_ranges_find_last", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["algorithm"] + }, + { + "name": "__cpp_lib_ranges_iota", + "values": { + "c++23": { + "202202": [ + { + "implemented": true + } + ] + } + }, + "headers": ["numeric"] + }, + { + "name": "__cpp_lib_ranges_join_with", + "values": { + "c++23": { + "202202": [ + { + "implemented": false + } + ] + } + }, + "headers": ["ranges"] + }, + { + "name": "__cpp_lib_ranges_repeat", + "values": { + "c++23": { + "202207": [ + { + "implemented": true + } + ] + } + }, + "headers": ["ranges"] + }, + { + "name": "__cpp_lib_ranges_slide", + "values": { + "c++23": { + "202202": [ + { + "implemented": false + } + ] + } + }, + "headers": ["ranges"] + }, + { + "name": "__cpp_lib_ranges_starts_ends_with", + "values": { + "c++23": { + "202106": [ + { + "implemented": true + } + ] + } + }, + "headers": ["algorithm"] + }, + { + "name": "__cpp_lib_ranges_to_container", + "values": { + "c++23": { + "202202": [ + { + "implemented": true + } + ] + } + }, + "headers": ["ranges"] + }, + { + "name": "__cpp_lib_ranges_zip", + "values": { + "c++23": { + "202110": [ + { + "implemented": false + } + ] + } + }, + "headers": ["ranges", "tuple", "utility"] + }, + { + "name": "__cpp_lib_ratio", + "values": { + "c++26": { + "202306": [ + { + "implemented": true + } + ] + } + }, + "headers": ["ratio"] + }, + { + "name": "__cpp_lib_raw_memory_algorithms", + "values": { + "c++17": { + "201606": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_rcu", + "values": { + "c++26": { + "202306": [ + { + "implemented": false + } + ] + } + }, + "headers": ["rcu"] + }, + { + "name": "__cpp_lib_reference_from_temporary", + "values": { + "c++23": { + "202202": [ + { + "implemented": false + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_reference_wrapper", + "values": { + "c++26": { + "202403": [ + { + "implemented": true + } + ] + } + }, + "headers": ["functional"] + }, + { + "name": "__cpp_lib_remove_cvref", + "values": { + "c++20": { + "201711": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_result_of_sfinae", + "values": { + "c++14": { + "201210": [ + { + "implemented": true + } + ] + } + }, + "headers": ["functional", "type_traits"] + }, + { + "name": "__cpp_lib_robust_nonmodifying_seq_ops", + "values": { + "c++14": { + "201304": [ + { + "implemented": true + } + ] + } + }, + "headers": ["algorithm"] + }, + { + "name": "__cpp_lib_sample", + "values": { + "c++17": { + "201603": [ + { + "implemented": true + } + ] + } + }, + "headers": ["algorithm"] + }, + { + "name": "__cpp_lib_saturation_arithmetic", + "values": { + "c++26": { + "202311": [ + { + "implemented": true + } + ] + } + }, + "headers": ["numeric"] + }, + { + "name": "__cpp_lib_scoped_lock", + "values": { + "c++17": { + "201703": [ + { + "implemented": true + } + ] + } + }, + "headers": ["mutex"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS", + "libcxx_guard": "_LIBCPP_HAS_THREADS" + }, + { + "name": "__cpp_lib_semaphore", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["semaphore"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC)", + "libcxx_guard": "_LIBCPP_HAS_THREADS && _LIBCPP_AVAILABILITY_HAS_SYNC" + }, + { + "name": "__cpp_lib_senders", + "values": { + "c++26": { + "202406": [ + { + "implemented": false + } + ] + } + }, + "headers": ["execution"] + }, + { + "name": "__cpp_lib_shared_mutex", + "values": { + "c++17": { + "201505": [ + { + "implemented": true + } + ] + } + }, + "headers": ["shared_mutex"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS", + "libcxx_guard": "_LIBCPP_HAS_THREADS" + }, + { + "name": "__cpp_lib_shared_ptr_arrays", + "values": { + "c++17": { + "201611": [ + { + "implemented": true + } + ] + }, + "c++20": { + "201707": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_shared_ptr_weak_type", + "values": { + "c++17": { + "201606": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_shared_timed_mutex", + "values": { + "c++14": { + "201402": [ + { + "implemented": true + } + ] + } + }, + "headers": ["shared_mutex"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_THREADS", + "libcxx_guard": "_LIBCPP_HAS_THREADS" + }, + { + "name": "__cpp_lib_shift", + "values": { + "c++20": { + "201806": [ + { + "implemented": true + } + ] + } + }, + "headers": ["algorithm"] + }, + { + "name": "__cpp_lib_smart_ptr_for_overwrite", + "values": { + "c++20": { + "202002": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_smart_ptr_owner_equality", + "values": { + "c++26": { + "202306": [ + { + "implemented": false + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_source_location", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["source_location"] + }, + { + "name": "__cpp_lib_span", + "values": { + "c++20": { + "202002": [ + { + "implemented": true + } + ] + } + }, + "headers": ["span"] + }, + { + "name": "__cpp_lib_span_at", + "values": { + "c++26": { + "202311": [ + { + "implemented": true + } + ] + } + }, + "headers": ["span"] + }, + { + "name": "__cpp_lib_span_initializer_list", + "values": { + "c++26": { + "202311": [ + { + "implemented": true + } + ] + } + }, + "headers": ["span"] + }, + { + "name": "__cpp_lib_spanstream", + "values": { + "c++23": { + "202106": [ + { + "implemented": false + } + ] + } + }, + "headers": ["spanstream"] + }, + { + "name": "__cpp_lib_ssize", + "values": { + "c++20": { + "201902": [ + { + "implemented": true + } + ] + } + }, + "headers": ["iterator"] + }, + { + "name": "__cpp_lib_sstream_from_string_view", + "values": { + "c++26": { + "202306": [ + { + "implemented": true + } + ] + } + }, + "headers": ["sstream"] + }, + { + "name": "__cpp_lib_stacktrace", + "values": { + "c++23": { + "202011": [ + { + "implemented": false + } + ] + } + }, + "headers": ["stacktrace"] + }, + { + "name": "__cpp_lib_starts_ends_with", + "values": { + "c++20": { + "201711": [ + { + "implemented": true + } + ] + } + }, + "headers": ["string", "string_view"] + }, + { + "name": "__cpp_lib_stdatomic_h", + "values": { + "c++23": { + "202011": [ + { + "implemented": true + } + ] + } + }, + "headers": ["stdatomic.h"] + }, + { + "name": "__cpp_lib_string_contains", + "values": { + "c++23": { + "202011": [ + { + "implemented": true + } + ] + } + }, + "headers": ["string", "string_view"] + }, + { + "name": "__cpp_lib_string_resize_and_overwrite", + "values": { + "c++23": { + "202110": [ + { + "implemented": true + } + ] + } + }, + "headers": ["string"] + }, + { + "name": "__cpp_lib_string_udls", + "values": { + "c++14": { + "201304": [ + { + "implemented": true + } + ] + } + }, + "headers": ["string"] + }, + { + "name": "__cpp_lib_string_view", + "values": { + "c++17": { + "201606": [ + { + "implemented": true + } + ] + }, + "c++20": { + "201803": [ + { + "implemented": true + } + ] + }, + "c++26": { + "202403": [ + { + "implemented": true + } + ] + } + }, + "headers": ["string", "string_view"] + }, + { + "name": "__cpp_lib_submdspan", + "values": { + "c++26": { + "202306": [ + { + "implemented": false + } + ] + } + }, + "headers": ["mdspan"] + }, + { + "name": "__cpp_lib_syncbuf", + "values": { + "c++20": { + "201803": [ + { + "implemented": true + } + ] + } + }, + "headers": ["syncstream"], + "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM", + "libcxx_guard": "_LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM" + }, + { + "name": "__cpp_lib_text_encoding", + "values": { + "c++26": { + "202306": [ + { + "implemented": false + } + ] + } + }, + "headers": ["text_encoding"] + }, + { + "name": "__cpp_lib_three_way_comparison", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["compare"] + }, + { + "name": "__cpp_lib_to_address", + "values": { + "c++20": { + "201711": [ + { + "implemented": true + } + ] + } + }, + "headers": ["memory"] + }, + { + "name": "__cpp_lib_to_array", + "values": { + "c++20": { + "201907": [ + { + "implemented": true + } + ] + } + }, + "headers": ["array"] + }, + { + "name": "__cpp_lib_to_chars", + "values": { + "c++17": { + "201611": [ + { + "implemented": false + } + ] + }, + "c++26": { + "202306": [ + { + "implemented": false + } + ] + } + }, + "headers": ["charconv"] + }, + { + "name": "__cpp_lib_to_string", + "values": { + "c++26": { + "202306": [ + { + "implemented": false + } + ] + } + }, + "headers": ["string"] + }, + { + "name": "__cpp_lib_to_underlying", + "values": { + "c++23": { + "202102": [ + { + "implemented": true + } + ] + } + }, + "headers": ["utility"] + }, + { + "name": "__cpp_lib_transformation_trait_aliases", + "values": { + "c++14": { + "201304": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_transparent_operators", + "values": { + "c++14": { + "201210": [ + { + "implemented": true + } + ] + }, + "c++17": { + "201510": [ + { + "implemented": true + } + ] + } + }, + "headers": ["functional", "memory"] + }, + { + "name": "__cpp_lib_tuple_element_t", + "values": { + "c++14": { + "201402": [ + { + "implemented": true + } + ] + } + }, + "headers": ["tuple"] + }, + { + "name": "__cpp_lib_tuple_like", + "values": { + "c++23": { + "202207": [ + { + "implemented": false + } + ] + }, + "c++26": { + "202311": [ + { + "implemented": false + } + ] + } + }, + "headers": ["map", "tuple", "unordered_map", "utility"] + }, + { + "name": "__cpp_lib_tuples_by_type", + "values": { + "c++14": { + "201304": [ + { + "implemented": true + } + ] + } + }, + "headers": ["tuple", "utility"] + }, + { + "name": "__cpp_lib_type_identity", + "values": { + "c++20": { + "201806": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_type_trait_variable_templates", + "values": { + "c++17": { + "201510": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + }, + { + "name": "__cpp_lib_uncaught_exceptions", + "values": { + "c++17": { + "201411": [ + { + "implemented": true + } + ] + } + }, + "headers": ["exception"] + }, + { + "name": "__cpp_lib_unordered_map_try_emplace", + "values": { + "c++17": { + "201411": [ + { + "implemented": true + } + ] + } + }, + "headers": ["unordered_map"] + }, + { + "name": "__cpp_lib_unreachable", + "values": { + "c++23": { + "202202": [ + { + "implemented": true + } + ] + } + }, + "headers": ["utility"] + }, + { + "name": "__cpp_lib_unwrap_ref", + "values": { + "c++20": { + "201811": [ + { + "implemented": true + } + ] + } + }, + "headers": ["functional"] + }, + { + "name": "__cpp_lib_variant", + "values": { + "c++17": { + "202102": [ + { + "implemented": true + } + ] + }, + "c++20": { + "202106": [ + { + "implemented": true + } + ] + }, + "c++26": { + "202306": [ + { + "implemented": true + } + ] + } + }, + "headers": ["variant"] + }, + { + "name": "__cpp_lib_void_t", + "values": { + "c++17": { + "201411": [ + { + "implemented": true + } + ] + } + }, + "headers": ["type_traits"] + } +] diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py index baca05f5e0772..af7374622c3c5 100755 --- a/libcxx/utils/generate_feature_test_macro_components.py +++ b/libcxx/utils/generate_feature_test_macro_components.py @@ -10,6 +10,7 @@ List, # Needed for python 3.8 compatibility. NewType, Optional, + Set, ) import functools import json @@ -1957,6 +1958,66 @@ def produce_docs(): with open(table_doc_path, "w", newline="\n") as f: f.write(doc_str) +def get_values(tc) -> str: + implemented = True if not "unimplemented" in tc.keys() else not tc["unimplemented"] + + return ",\n".join("""\ + "{std}": {{ + "{value}": [ + {{ + "implemented": {implemented} + }} + ] + }}\ +""".format(std=key, value=tc["values"][key], implemented="true" if implemented else "false") for key in tc["values"].keys()) + +def get_headers(tc) -> str: + headers = tc["headers"] + headers.remove("version") + return f'{headers}'.replace("'", '"') + +def get_test_suite_guard(tc) -> str: + if not "test_suite_guard" in tc.keys(): + return "" + return f',\n "test_suite_guard": "{tc["test_suite_guard"]}"' + +def get_libcxx_guard(tc) -> str: + if not "libcxx_guard" in tc.keys(): + return "" + return f',\n "libcxx_guard": "{tc["libcxx_guard"]}"' + +def get_ftm_json(tc) -> str: + data="""\ + {{ + "name": "{ftm}", + "values": {{ +{values} + }}, + "headers": {headers}{test_suite_guard}{libcxx_guard} + }}\ +""".format( + ftm=tc["name"], + values=get_values(tc), + headers=get_headers(tc), + test_suite_guard=get_test_suite_guard(tc), + libcxx_guard=get_libcxx_guard(tc), + ) + return data + + +def get_json() -> str: + return ",\n".join(get_ftm_json(tc) for tc in feature_test_macros) + + +def produce_json(file: os.path) -> None: + contents = """\ +[ +{data} +] +""".format(data=get_json()) + with open(file, "w", newline="\n") as f: + f.write(contents) + Std = NewType("Std", str) # Standard version number Ftm = NewType("Ftm", str) # The name of a feature test macro @@ -1965,6 +2026,7 @@ def produce_docs(): @dataclass class Metadata: headers: List[str] = None + available_since: Std = None test_suite_guard: str = None libcxx_guard: str = None @@ -1977,6 +2039,12 @@ class VersionHeader: condition: str = None +@dataclass +class FtmHeaderTest: + value: Value = None + implemented: bool = None + condition: str = None + def get_ftms( data, std_dialects: List[Std], use_implemented_status: bool ) -> Dict[Ftm, Dict[Std, Optional[Value]]]: @@ -2067,6 +2135,101 @@ def generate_version_header_implementation( return "\n\n".join(result) +# +# The templates used to create a FTM test file +# + + +ftm_header_test_file_contents = """//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// WARNING: This test was generated by {script_name} +// and should not be edited manually. + +{lit_markup}// <{header}> + +// Test the feature test macros defined by <{header}> + +// clang-format off + +{include} +#include "test_macros.h" +{data} + +// clang-format on + +""" + + +ftm_header_test_file_include_unconditional = """\ +#include <{header}>\ +""" + +ftm_header_test_file_include_conditional = """\ +#if __has_include(<{header}>) +# include <{header}> +#endif\ +""" + +ftm_header_test_file_dialect_block = """ +#{pp_if} TEST_STD_VER {operator} {dialect} +{tests}\ +""" + +# +# The templates used for a single FTM block in the tests. +# + +ftm_unavailable_in_dialect = """ +# ifdef {ftm} +# error "{ftm} should not be defined before {dialect}" +# endif +""" + +libcxx_ftm_not_implemented = """ +# if !defined(_LIBCPP_VERSION) +# ifndef {ftm} +# error "{ftm} should be defined in {dialect}" +# endif +# if {ftm} != {value} +# error "{ftm} should have the value {value} in {dialect}" +# endif +# else +# ifdef {ftm} +# error "{ftm} should not be defined because it is unimplemented in libc++!" +# endif +# endif +""" + +libcxx_ftm_conditionally_implemented = """ +# if {condition} +# ifndef {ftm} +# error "{ftm} should be defined in {dialect}" +# endif +# if {ftm} != {value} +# error "{ftm} should have the value {value} in {dialect}" +# endif +# else +# ifdef {ftm} +# error "{ftm} should not be defined when the requirement '{condition}' is not met!" +# endif +# endif +""" + +libcxx_ftm_implemented = """ +# ifndef {ftm} +# error "{ftm} should be defined in {dialect}" +# endif +# if {ftm} != {value} +# error "{ftm} should have the value {value} in {dialect}" +# endif +""" + class FeatureTestMacros: """Provides all feature-test macro (FTM) output components. @@ -2197,6 +2360,17 @@ def standard_ftms(self) -> Dict[Ftm, Dict[Std, Optional[Value]]]: """ return get_ftms(self.__data, self.std_dialects, False) + @functools.cached_property + def standard_library_headers(self) -> Set[str]: + """Returns a list of headers that contain at least one FTM.""" + + result = set() + for value in self.ftm_metadata.values(): + for header in value.headers: + result.add(header) + + return list(result) + @functools.cached_property def implemented_ftms(self) -> Dict[Ftm, Dict[Std, Optional[Value]]]: """Returns the FTM versions per dialect implemented in libc++. @@ -2207,6 +2381,33 @@ def implemented_ftms(self) -> Dict[Ftm, Dict[Std, Optional[Value]]]: return get_ftms(self.__data, self.std_dialects, True) + @functools.cached_property + def implemented_standard_library_headers(self) -> Set[str]: + """Returns a list of headers that contain at least one paper implemented in libc++. + + When a paper is implemented it means the associated header(s) should exist. + """ + + result = set() + for feature in self.__data: + for std in self.std_dialects: + if std in feature["values"].keys(): + values = feature["values"][std] + assert len(values) > 0, f"{feature['name']}[{std}] has no entries" + for value in values: + papers = list(values[value]) + assert ( + len(papers) > 0 + ), f"{feature['name']}[{std}][{value}] has no entries" + for paper in papers: + if paper["implemented"]: + for header in self.ftm_metadata[feature["name"]].headers: + result.add(header) + break + + return result + + def is_implemented(self, ftm: Ftm, std: Std) -> bool: """Has the FTM `ftm` been implemented in the dialect `std`?""" @@ -2218,7 +2419,6 @@ def is_implemented(self, ftm: Ftm, std: Std) -> bool: return self.implemented_ftms[ftm][std] == self.standard_ftms[ftm][std] - @functools.cached_property def ftm_metadata(self) -> Dict[Ftm, Metadata]: """Returns the metadata of the FTMs defined in the Standard. @@ -2229,6 +2429,7 @@ def ftm_metadata(self) -> Dict[Ftm, Metadata]: for feature in self.__data: result[feature["name"]] = Metadata( feature["headers"], + list(feature["values"])[0], feature.get("test_suite_guard", None), feature.get("libcxx_guard", None), ) @@ -2296,14 +2497,169 @@ def version_header(self) -> str: ) ) + def header_ftm(self, header: str) -> Dict[Std, List[Dict[Ftm, FtmHeaderTest]]]: + """Generates the FTM information for a `header`.""" + + result = dict() + for std in self.std_dialects: + result[get_std_number(std)] = list() + + for ftm, values in self.standard_ftms.items(): + if not header in self.ftm_metadata[ftm].headers: + continue + + last_value = None + last_entry = None + + for std in self.std_dialects: + if not std in values.keys(): + result[get_std_number(std)].append(dict({ftm: None})) + continue + + result[get_std_number(std)].append( + dict( + { + ftm: FtmHeaderTest( + values[std], + self.is_implemented(ftm, std), + self.ftm_metadata[ftm].test_suite_guard, + ) + } + ) + ) + + return result + + + def generate_header_test_ftm(self, std: Std, ftm: Ftm, value: FtmHeaderTest) -> str: + """Adds a single `ftm` test for C++ `std` based on the status information in `value`. + + When std == None this test is generating the TEST_STD_VER < MIN. Where + MIN is the minimum version that has a FTM defined. (In the real data + this is 14, since FTM have been introduced in C++14.) + """ + + if std == None or value == None: + return ftm_unavailable_in_dialect.format( + ftm=ftm, dialect=self.ftm_metadata[ftm].available_since + ) + + if not value.implemented: + return libcxx_ftm_not_implemented.format( + ftm=ftm, value=value.value, dialect=std + ) + + if self.ftm_metadata[ftm].test_suite_guard: + return libcxx_ftm_conditionally_implemented.format( + ftm=ftm, + value=value.value, + dialect=std, + condition=self.ftm_metadata[ftm].test_suite_guard, + ) + + return libcxx_ftm_implemented.format(ftm=ftm, value=value.value, dialect=std) + + def generate_header_test_dialect( + self, std: Std, data: List[Dict[Ftm, FtmHeaderTest]] + ) -> str: + """Returns the body a single `std` for the FTM test of a `header`.""" + return "".join( + self.generate_header_test_ftm(std, ftm, value) + for element in data + for ftm, value in element.items() + ) + + def generate_lit_markup(self, header:str) -> str: + if not header in lit_markup.keys(): + return "" + + return "\n".join(f"// {markup}" for markup in lit_markup[header]) + "\n\n" + + def generate_header_test(self, header: str) -> str: + """Returns the body for the FTM test of a `header`.""" + + return ftm_header_test_file_contents.format( + script_name=script_name, + lit_markup=self.generate_lit_markup(header), + header=header, + include=( + ftm_header_test_file_include_unconditional.format(header=header) + if header in self.implemented_standard_library_headers + else ftm_header_test_file_include_conditional.format(header=header) + ), + data= + # FTM block before the first Standard that introduced them. + # This test the macros are not available before this version. + ftm_header_test_file_dialect_block.format( + pp_if="if", + operator="<", + dialect=self.std_dialects[0][3:], + tests=self.generate_header_test_dialect( + None, next(iter(self.header_ftm(header).values())) + ), + ) + + + # FTM for all Standards that have FTM defined. + # Note in libc++ the TEST_STD_VER contains 99 for the Standard + # in development, therefore the last entry uses a different #elif. + "".join( + ftm_header_test_file_dialect_block.format( + pp_if="elif", + operator="==" if std != self.std_dialects[-1][3:] else ">", + dialect=std + if std != self.std_dialects[-1][3:] + else self.std_dialects[-2][3:], + tests=self.generate_header_test_dialect(f"c++{std}", values), + ) + for std, values in self.header_ftm(header).items() + ) + + + # The final #endif for the last #elif block. + f"\n#endif // TEST_STD_VER > {self.std_dialects[-2][3:]}", + ) + + def generate_header_test_directory(self, path: os.path) -> None: + """Generates all FTM tests in the directory `path`.""" + + if not os.path.exists(path): + os.makedirs(path) + + for header in self.standard_library_headers: + with open( + os.path.join(path, f"{header}.version.compile.pass.cpp"), + "w", + newline="\n", + ) as f: + f.write(self.generate_header_test(header)) + def main(): + # + # Note this generator switches from the data structures in this file (v1) + # to data structures in an external json file (v2). This project is in its + # transition phase. So currently both data structures are present. + # + + # Generation using data structure v1 produce_version_header() produce_tests() produce_docs() - # Example how to use the new version header generation function to generate - # the file. + # + # Conversion of the v1 data to v2 data. + # This is a temporary solution. + # + produce_json( + os.path.join(source_root, "utils", "data", "feature_test_macro", "data.json") + ) + + # Generation using data structure v2 + ftm = FeatureTestMacros( + os.path.join(source_root, "utils", "data", "feature_test_macro", "data.json") + ) + ftm.generate_header_test_directory(os.path.join(macro_test_path, "v2")) + + # Example how to use the generator v2 to generate the output. if False: ftm = FeatureTestMacros( os.path.join( @@ -2314,6 +2670,8 @@ def main(): with open(version_header_path, "w", newline="\n") as f: f.write(ftm.version_header) + ftm.generate_header_test_directory(macro_test_path) + if __name__ == "__main__": main()