1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// WARNING: This test was generated by generate_feature_test_macro_components.py
10// and should not be edited manually.
11
12// UNSUPPORTED: no-localization
13
14// <syncstream>
15
16// Test the feature test macros defined by <syncstream>
17
18// clang-format off
19
20#include <syncstream>
21#include "test_macros.h"
22
23#if TEST_STD_VER < 14
24
25# ifdef __cpp_lib_syncbuf
26# error "__cpp_lib_syncbuf should not be defined before c++20"
27# endif
28
29#elif TEST_STD_VER == 14
30
31# ifdef __cpp_lib_syncbuf
32# error "__cpp_lib_syncbuf should not be defined before c++20"
33# endif
34
35#elif TEST_STD_VER == 17
36
37# ifdef __cpp_lib_syncbuf
38# error "__cpp_lib_syncbuf should not be defined before c++20"
39# endif
40
41#elif TEST_STD_VER == 20
42
43# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
44# ifndef __cpp_lib_syncbuf
45# error "__cpp_lib_syncbuf should be defined in c++20"
46# endif
47# if __cpp_lib_syncbuf != 201803L
48# error "__cpp_lib_syncbuf should have the value 201803L in c++20"
49# endif
50# else
51# ifdef __cpp_lib_syncbuf
52# error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
53# endif
54# endif
55
56#elif TEST_STD_VER == 23
57
58# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
59# ifndef __cpp_lib_syncbuf
60# error "__cpp_lib_syncbuf should be defined in c++23"
61# endif
62# if __cpp_lib_syncbuf != 201803L
63# error "__cpp_lib_syncbuf should have the value 201803L in c++23"
64# endif
65# else
66# ifdef __cpp_lib_syncbuf
67# error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
68# endif
69# endif
70
71#elif TEST_STD_VER > 23
72
73# if !defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM
74# ifndef __cpp_lib_syncbuf
75# error "__cpp_lib_syncbuf should be defined in c++26"
76# endif
77# if __cpp_lib_syncbuf != 201803L
78# error "__cpp_lib_syncbuf should have the value 201803L in c++26"
79# endif
80# else
81# ifdef __cpp_lib_syncbuf
82# error "__cpp_lib_syncbuf should not be defined when the requirement '!defined(_LIBCPP_VERSION) || _LIBCPP_HAS_EXPERIMENTAL_SYNCSTREAM' is not met!"
83# endif
84# endif
85
86#endif // TEST_STD_VER > 23
87
88// clang-format on
89
90

source code of libcxx/test/std/language.support/support.limits/support.limits.general/syncstream.version.compile.pass.cpp