libcxx

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

string.version.pass.cpp (5565B)


      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 // <string>
     14 
     15 // Test the feature test macros defined by <string>
     16 
     17 /*  Constant                                      Value
     18     __cpp_lib_allocator_traits_is_always_equal    201411L [C++17]
     19     __cpp_lib_char8_t                             201811L [C++2a]
     20     __cpp_lib_erase_if                            201811L [C++2a]
     21     __cpp_lib_nonmember_container_access          201411L [C++17]
     22     __cpp_lib_string_udls                         201304L [C++14]
     23     __cpp_lib_string_view                         201606L [C++17]
     24 */
     25 
     26 #include <string>
     27 #include "test_macros.h"
     28 
     29 #if TEST_STD_VER < 14
     30 
     31 # ifdef __cpp_lib_allocator_traits_is_always_equal
     32 #   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
     33 # endif
     34 
     35 # ifdef __cpp_lib_char8_t
     36 #   error "__cpp_lib_char8_t should not be defined before c++2a"
     37 # endif
     38 
     39 # ifdef __cpp_lib_erase_if
     40 #   error "__cpp_lib_erase_if should not be defined before c++2a"
     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_string_udls
     48 #   error "__cpp_lib_string_udls should not be defined before c++14"
     49 # endif
     50 
     51 # ifdef __cpp_lib_string_view
     52 #   error "__cpp_lib_string_view should not be defined before c++17"
     53 # endif
     54 
     55 #elif TEST_STD_VER == 14
     56 
     57 # ifdef __cpp_lib_allocator_traits_is_always_equal
     58 #   error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
     59 # endif
     60 
     61 # ifdef __cpp_lib_char8_t
     62 #   error "__cpp_lib_char8_t should not be defined before c++2a"
     63 # endif
     64 
     65 # ifdef __cpp_lib_erase_if
     66 #   error "__cpp_lib_erase_if should not be defined before c++2a"
     67 # endif
     68 
     69 # ifdef __cpp_lib_nonmember_container_access
     70 #   error "__cpp_lib_nonmember_container_access should not be defined before c++17"
     71 # endif
     72 
     73 # ifndef __cpp_lib_string_udls
     74 #   error "__cpp_lib_string_udls should be defined in c++14"
     75 # endif
     76 # if __cpp_lib_string_udls != 201304L
     77 #   error "__cpp_lib_string_udls should have the value 201304L in c++14"
     78 # endif
     79 
     80 # ifdef __cpp_lib_string_view
     81 #   error "__cpp_lib_string_view should not be defined before c++17"
     82 # endif
     83 
     84 #elif TEST_STD_VER == 17
     85 
     86 # ifndef __cpp_lib_allocator_traits_is_always_equal
     87 #   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
     88 # endif
     89 # if __cpp_lib_allocator_traits_is_always_equal != 201411L
     90 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
     91 # endif
     92 
     93 # ifdef __cpp_lib_char8_t
     94 #   error "__cpp_lib_char8_t should not be defined before c++2a"
     95 # endif
     96 
     97 # ifdef __cpp_lib_erase_if
     98 #   error "__cpp_lib_erase_if should not be defined before c++2a"
     99 # endif
    100 
    101 # ifndef __cpp_lib_nonmember_container_access
    102 #   error "__cpp_lib_nonmember_container_access should be defined in c++17"
    103 # endif
    104 # if __cpp_lib_nonmember_container_access != 201411L
    105 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
    106 # endif
    107 
    108 # ifndef __cpp_lib_string_udls
    109 #   error "__cpp_lib_string_udls should be defined in c++17"
    110 # endif
    111 # if __cpp_lib_string_udls != 201304L
    112 #   error "__cpp_lib_string_udls should have the value 201304L in c++17"
    113 # endif
    114 
    115 # ifndef __cpp_lib_string_view
    116 #   error "__cpp_lib_string_view should be defined in c++17"
    117 # endif
    118 # if __cpp_lib_string_view != 201606L
    119 #   error "__cpp_lib_string_view should have the value 201606L in c++17"
    120 # endif
    121 
    122 #elif TEST_STD_VER > 17
    123 
    124 # ifndef __cpp_lib_allocator_traits_is_always_equal
    125 #   error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++2a"
    126 # endif
    127 # if __cpp_lib_allocator_traits_is_always_equal != 201411L
    128 #   error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++2a"
    129 # endif
    130 
    131 # if defined(__cpp_char8_t)
    132 #   ifndef __cpp_lib_char8_t
    133 #     error "__cpp_lib_char8_t should be defined in c++2a"
    134 #   endif
    135 #   if __cpp_lib_char8_t != 201811L
    136 #     error "__cpp_lib_char8_t should have the value 201811L in c++2a"
    137 #   endif
    138 # else
    139 #   ifdef __cpp_lib_char8_t
    140 #     error "__cpp_lib_char8_t should not be defined when defined(__cpp_char8_t) is not defined!"
    141 #   endif
    142 # endif
    143 
    144 # ifndef __cpp_lib_erase_if
    145 #   error "__cpp_lib_erase_if should be defined in c++2a"
    146 # endif
    147 # if __cpp_lib_erase_if != 201811L
    148 #   error "__cpp_lib_erase_if should have the value 201811L in c++2a"
    149 # endif
    150 
    151 # ifndef __cpp_lib_nonmember_container_access
    152 #   error "__cpp_lib_nonmember_container_access should be defined in c++2a"
    153 # endif
    154 # if __cpp_lib_nonmember_container_access != 201411L
    155 #   error "__cpp_lib_nonmember_container_access should have the value 201411L in c++2a"
    156 # endif
    157 
    158 # ifndef __cpp_lib_string_udls
    159 #   error "__cpp_lib_string_udls should be defined in c++2a"
    160 # endif
    161 # if __cpp_lib_string_udls != 201304L
    162 #   error "__cpp_lib_string_udls should have the value 201304L in c++2a"
    163 # endif
    164 
    165 # ifndef __cpp_lib_string_view
    166 #   error "__cpp_lib_string_view should be defined in c++2a"
    167 # endif
    168 # if __cpp_lib_string_view != 201606L
    169 #   error "__cpp_lib_string_view should have the value 201606L in c++2a"
    170 # endif
    171 
    172 #endif // TEST_STD_VER > 17
    173 
    174 int main() {}