• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 //===----------------------------------------------------------------------===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is dual licensed under the MIT and the University of Illinois Open
7 // Source Licenses. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10 //
11 // <string> feature macros
12 
13 /*  Constant                                    Value
14     __cpp_lib_allocator_traits_is_always_equal  201411L
15     __cpp_lib_erase_if                          201811L
16     __cpp_lib_char8_t                           201811L
17     __cpp_lib_nonmember_container_access        201411L
18     __cpp_lib_string_udls                       201304L
19     __cpp_lib_string_view                       201606L
20 
21 */
22 
23 #include <string>
24 #include <cassert>
25 #include "test_macros.h"
26 
main()27 int main()
28 {
29 //  ensure that the macros that are supposed to be defined in <string> are defined.
30 
31 #if TEST_STD_VER > 17
32 # if !defined(__cpp_lib_erase_if)
33   LIBCPP_STATIC_ASSERT(false, "__cpp_lib_erase_if is not defined");
34 # else
35 #  if __cpp_lib_erase_if < 201811L
36 #   error "__cpp_lib_erase_if has an invalid value"
37 #  endif
38 # endif
39 #endif
40 
41 #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
42 # if !defined(__cpp_lib_char8_t)
43   LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
44 # else
45 #  if __cpp_lib_char8_t < 201811L
46 #   error "__cpp_lib_char8_t has an invalid value"
47 #  endif
48 # endif
49 #endif
50 
51 /*
52 #if !defined(__cpp_lib_fooby)
53 # error "__cpp_lib_fooby is not defined"
54 #elif __cpp_lib_fooby < 201606L
55 # error "__cpp_lib_fooby has an invalid value"
56 #endif
57 */
58 }
59