libcxx

libcxx mirror with random patches
git clone https://git.neptards.moe/neptards/libcxx.git
Log | Files | Refs

iterator.version.pass.cpp (5906B)


      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 //
     10 // WARNING: This test was generated by generate_feature_test_macro_components.py
     11 // and should not be edited manually.
     12 
     13 // <iterator>
     14 
     15 // Test the feature test macros defined by <iterator>
     16 
     17 /*  Constant                                Value
     18     __cpp_lib_array_constexpr               201603L [C++17]
     19     __cpp_lib_constexpr_misc                201811L [C++2a]
     20     __cpp_lib_make_reverse_iterator         201402L [C++14]
     21     __cpp_lib_nonmember_container_access    201411L [C++17]
     22     __cpp_lib_null_iterators                201304L [C++14]
     23     __cpp_lib_ranges                        201811L [C++2a]
     24 */
     25 
     26 #include <iterator>
     27 #include "test_macros.h"
     28 
     29 #if TEST_STD_VER < 14
     30 
     31 # ifdef __cpp_lib_array_constexpr
     32 #   error "__cpp_lib_array_constexpr should not be defined before c++17"
     33 # endif
     34 
     35 # ifdef __cpp_lib_constexpr_misc
     36 #   error "__cpp_lib_constexpr_misc should not be defined before c++2a"
     37 # endif
     38 
     39 # ifdef __cpp_lib_make_reverse_iterator
     40 #   error "__cpp_lib_make_reverse_iterator should not be defined before c++14"
     41 # endif
     42 
     43 # ifdef __cpp_lib_nonmember_container_access
     44 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
     45 # endif
     46 
     47 # ifdef __cpp_lib_null_iterators
     48 #   error "__cpp_lib_null_iterators should not be defined before c++14"
     49 # endif
     50 
     51 # ifdef __cpp_lib_ranges
     52 #   error "__cpp_lib_ranges should not be defined before c++2a"
     53 # endif
     54 
     55 #elif TEST_STD_VER == 14
     56 
     57 # ifdef __cpp_lib_array_constexpr
     58 #   error "__cpp_lib_array_constexpr should not be defined before c++17"
     59 # endif
     60 
     61 # ifdef __cpp_lib_constexpr_misc
     62 #   error "__cpp_lib_constexpr_misc should not be defined before c++2a"
     63 # endif
     64 
     65 # ifndef __cpp_lib_make_reverse_iterator
     66 #   error "__cpp_lib_make_reverse_iterator should be defined in c++14"
     67 # endif
     68 # if __cpp_lib_make_reverse_iterator != 201402L
     69 #   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++14"
     70 # endif
     71 
     72 # ifdef __cpp_lib_nonmember_container_access
     73 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
     74 # endif
     75 
     76 # ifndef __cpp_lib_null_iterators
     77 #   error "__cpp_lib_null_iterators should be defined in c++14"
     78 # endif
     79 # if __cpp_lib_null_iterators != 201304L
     80 #   error "__cpp_lib_null_iterators should have the value 201304L in c++14"
     81 # endif
     82 
     83 # ifdef __cpp_lib_ranges
     84 #   error "__cpp_lib_ranges should not be defined before c++2a"
     85 # endif
     86 
     87 #elif TEST_STD_VER == 17
     88 
     89 # ifndef __cpp_lib_array_constexpr
     90 #   error "__cpp_lib_array_constexpr should be defined in c++17"
     91 # endif
     92 # if __cpp_lib_array_constexpr != 201603L
     93 #   error "__cpp_lib_array_constexpr should have the value 201603L in c++17"
     94 # endif
     95 
     96 # ifdef __cpp_lib_constexpr_misc
     97 #   error "__cpp_lib_constexpr_misc should not be defined before c++2a"
     98 # endif
     99 
    100 # ifndef __cpp_lib_make_reverse_iterator
    101 #   error "__cpp_lib_make_reverse_iterator should be defined in c++17"
    102 # endif
    103 # if __cpp_lib_make_reverse_iterator != 201402L
    104 #   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++17"
    105 # endif
    106 
    107 # ifndef __cpp_lib_nonmember_container_access
    108 #   error "__cpp_lib_nonmember_container_access should be defined in c++17"
    109 # endif
    110 # if __cpp_lib_nonmember_container_access != 201411L
    111 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
    112 # endif
    113 
    114 # ifndef __cpp_lib_null_iterators
    115 #   error "__cpp_lib_null_iterators should be defined in c++17"
    116 # endif
    117 # if __cpp_lib_null_iterators != 201304L
    118 #   error "__cpp_lib_null_iterators should have the value 201304L in c++17"
    119 # endif
    120 
    121 # ifdef __cpp_lib_ranges
    122 #   error "__cpp_lib_ranges should not be defined before c++2a"
    123 # endif
    124 
    125 #elif TEST_STD_VER > 17
    126 
    127 # ifndef __cpp_lib_array_constexpr
    128 #   error "__cpp_lib_array_constexpr should be defined in c++2a"
    129 # endif
    130 # if __cpp_lib_array_constexpr != 201603L
    131 #   error "__cpp_lib_array_constexpr should have the value 201603L in c++2a"
    132 # endif
    133 
    134 # if !defined(_LIBCPP_VERSION)
    135 #   ifndef __cpp_lib_constexpr_misc
    136 #     error "__cpp_lib_constexpr_misc should be defined in c++2a"
    137 #   endif
    138 #   if __cpp_lib_constexpr_misc != 201811L
    139 #     error "__cpp_lib_constexpr_misc should have the value 201811L in c++2a"
    140 #   endif
    141 # else // _LIBCPP_VERSION
    142 #   ifdef __cpp_lib_constexpr_misc
    143 #     error "__cpp_lib_constexpr_misc should not be defined because it is unimplemented in libc++!"
    144 #   endif
    145 # endif
    146 
    147 # ifndef __cpp_lib_make_reverse_iterator
    148 #   error "__cpp_lib_make_reverse_iterator should be defined in c++2a"
    149 # endif
    150 # if __cpp_lib_make_reverse_iterator != 201402L
    151 #   error "__cpp_lib_make_reverse_iterator should have the value 201402L in c++2a"
    152 # endif
    153 
    154 # ifndef __cpp_lib_nonmember_container_access
    155 #   error "__cpp_lib_nonmember_container_access should be defined in c++2a"
    156 # endif
    157 # if __cpp_lib_nonmember_container_access != 201411L
    158 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++2a"
    159 # endif
    160 
    161 # ifndef __cpp_lib_null_iterators
    162 #   error "__cpp_lib_null_iterators should be defined in c++2a"
    163 # endif
    164 # if __cpp_lib_null_iterators != 201304L
    165 #   error "__cpp_lib_null_iterators should have the value 201304L in c++2a"
    166 # endif
    167 
    168 # if !defined(_LIBCPP_VERSION)
    169 #   ifndef __cpp_lib_ranges
    170 #     error "__cpp_lib_ranges should be defined in c++2a"
    171 #   endif
    172 #   if __cpp_lib_ranges != 201811L
    173 #     error "__cpp_lib_ranges should have the value 201811L in c++2a"
    174 #   endif
    175 # else // _LIBCPP_VERSION
    176 #   ifdef __cpp_lib_ranges
    177 #     error "__cpp_lib_ranges should not be defined because it is unimplemented in libc++!"
    178 #   endif
    179 # endif
    180 
    181 #endif // TEST_STD_VER > 17
    182 
    183 int main() {}