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 | // <fstream> |
15 | |
16 | // Test the feature test macros defined by <fstream> |
17 | |
18 | // clang-format off |
19 | |
20 | #include <fstream> |
21 | #include "test_macros.h" |
22 | |
23 | #if TEST_STD_VER < 14 |
24 | |
25 | # ifdef __cpp_lib_fstream_native_handle |
26 | # error "__cpp_lib_fstream_native_handle should not be defined before c++26" |
27 | # endif |
28 | |
29 | #elif TEST_STD_VER == 14 |
30 | |
31 | # ifdef __cpp_lib_fstream_native_handle |
32 | # error "__cpp_lib_fstream_native_handle should not be defined before c++26" |
33 | # endif |
34 | |
35 | #elif TEST_STD_VER == 17 |
36 | |
37 | # ifdef __cpp_lib_fstream_native_handle |
38 | # error "__cpp_lib_fstream_native_handle should not be defined before c++26" |
39 | # endif |
40 | |
41 | #elif TEST_STD_VER == 20 |
42 | |
43 | # ifdef __cpp_lib_fstream_native_handle |
44 | # error "__cpp_lib_fstream_native_handle should not be defined before c++26" |
45 | # endif |
46 | |
47 | #elif TEST_STD_VER == 23 |
48 | |
49 | # ifdef __cpp_lib_fstream_native_handle |
50 | # error "__cpp_lib_fstream_native_handle should not be defined before c++26" |
51 | # endif |
52 | |
53 | #elif TEST_STD_VER > 23 |
54 | |
55 | # if !defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION) |
56 | # ifndef __cpp_lib_fstream_native_handle |
57 | # error "__cpp_lib_fstream_native_handle should be defined in c++26" |
58 | # endif |
59 | # if __cpp_lib_fstream_native_handle != 202306L |
60 | # error "__cpp_lib_fstream_native_handle should have the value 202306L in c++26" |
61 | # endif |
62 | # else |
63 | # ifdef __cpp_lib_fstream_native_handle |
64 | # error "__cpp_lib_fstream_native_handle should not be defined when the requirement '!defined(_LIBCPP_VERSION) || (_LIBCPP_HAS_FILESYSTEM && _LIBCPP_HAS_LOCALIZATION)' is not met!" |
65 | # endif |
66 | # endif |
67 | |
68 | #endif // TEST_STD_VER > 23 |
69 | |
70 | // clang-format on |
71 | |
72 | |