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 // clang-format off
13 
14 // <variant>
15 
16 // Test the feature test macros defined by <variant>
17 
18 /*  Constant             Value
19     __cpp_lib_variant    202102L [C++17]
20 */
21 
22 #include <variant>
23 #include "test_macros.h"
24 
25 #if TEST_STD_VER < 14
26 
27 # ifdef __cpp_lib_variant
28 #   error "__cpp_lib_variant should not be defined before c++17"
29 # endif
30 
31 #elif TEST_STD_VER == 14
32 
33 # ifdef __cpp_lib_variant
34 #   error "__cpp_lib_variant should not be defined before c++17"
35 # endif
36 
37 #elif TEST_STD_VER == 17
38 
39 # ifndef __cpp_lib_variant
40 #   error "__cpp_lib_variant should be defined in c++17"
41 # endif
42 # if __cpp_lib_variant != 202102L
43 #   error "__cpp_lib_variant should have the value 202102L in c++17"
44 # endif
45 
46 #elif TEST_STD_VER == 20
47 
48 # ifndef __cpp_lib_variant
49 #   error "__cpp_lib_variant should be defined in c++20"
50 # endif
51 # if __cpp_lib_variant != 202102L
52 #   error "__cpp_lib_variant should have the value 202102L in c++20"
53 # endif
54 
55 #elif TEST_STD_VER > 20
56 
57 # ifndef __cpp_lib_variant
58 #   error "__cpp_lib_variant should be defined in c++2b"
59 # endif
60 # if __cpp_lib_variant != 202102L
61 #   error "__cpp_lib_variant should have the value 202102L in c++2b"
62 # endif
63 
64 #endif // TEST_STD_VER > 20
65 
66