File tree Expand file tree Collapse file tree 1 file changed +15
-9
lines changed
tests/std/tests/Dev11_0000000_null_forward_iterators Expand file tree Collapse file tree 1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright (c) Microsoft Corporation.
2
2
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3
3
4
- #define _SILENCE_CXX23_ALIGNED_UNION_DEPRECATION_WARNING
5
4
#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
6
5
#define _SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
7
6
10
9
#include < cstring>
11
10
#include < deque>
12
11
#include < experimental/filesystem>
13
- #include < filesystem>
14
12
#include < forward_list>
15
13
#include < iterator>
16
14
#include < list>
17
15
#include < map>
18
16
#include < new>
19
17
#include < regex>
20
18
#include < set>
21
- #include < span>
22
19
#include < string>
23
20
#include < type_traits>
24
21
#include < unordered_map>
25
22
#include < unordered_set>
26
23
#include < vector>
27
24
25
+ #if _HAS_CXX17
26
+ #include < filesystem>
27
+ #include < string_view>
28
+ #endif // _HAS_CXX17
29
+
30
+ #if _HAS_CXX20
31
+ #include < span>
32
+ #endif // _HAS_CXX20
33
+
28
34
using namespace std ;
29
35
30
36
// N3797 24.2.5 [forward.iterators]/2:
@@ -91,14 +97,14 @@ void test_iterator() {
91
97
}
92
98
93
99
{
94
- aligned_union_t < 0 , FwdIt> au3 ;
95
- aligned_union_t < 0 , FwdIt> au4 ;
100
+ alignas ( FwdIt) unsigned char buf3[ sizeof (FwdIt)] ;
101
+ alignas ( FwdIt) unsigned char buf4[ sizeof (FwdIt)] ;
96
102
97
- FwdIt* p3 = reinterpret_cast <FwdIt*>(&au3 );
98
- FwdIt* p4 = reinterpret_cast <FwdIt*>(&au4 );
103
+ memset (buf3, 0xCC , sizeof (FwdIt) );
104
+ memset (buf4, 0xDD , sizeof (FwdIt) );
99
105
100
- memset (p3, 0xCC , sizeof ( FwdIt) );
101
- memset (p4, 0xDD , sizeof ( FwdIt) );
106
+ FwdIt* p3 = reinterpret_cast < FwdIt*>(buf3 );
107
+ FwdIt* p4 = reinterpret_cast < FwdIt*>(buf4 );
102
108
103
109
new (p3) FwdIt{};
104
110
new (p4) FwdIt{};
You can’t perform that action at this time.
0 commit comments