Skip to content

Commit 042f07e

Browse files
committed
Implement P0767R1 - Deprecate POD
llvm-svn: 326801
1 parent ad96d9a commit 042f07e

File tree

4 files changed

+116
-3
lines changed

4 files changed

+116
-3
lines changed

libcxx/test/std/language.support/support.types/byte.pass.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@
99

1010
#include <cstddef>
1111
#include <type_traits>
12-
#include <test_macros.h>
12+
#include "test_macros.h"
1313

1414
// XFAIL: c++98, c++03, c++11, c++14
1515

1616
// std::byte is not an integer type, nor a character type.
1717
// It is a distinct type for accessing the bits that ultimately make up object storage.
1818

19+
#if TEST_STD_VER > 17
20+
static_assert( std::is_trivial<std::byte>::value, "" ); // P0767
21+
#else
1922
static_assert( std::is_pod<std::byte>::value, "" );
23+
#endif
2024
static_assert(!std::is_arithmetic<std::byte>::value, "" );
2125
static_assert(!std::is_integral<std::byte>::value, "" );
2226

libcxx/test/std/language.support/support.types/max_align_t.pass.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,18 @@
1414
// great as that of every scalar type
1515

1616
#include <stdio.h>
17+
#include "test_macros.h"
1718

1819
int main()
1920
{
21+
#if TEST_STD_VER > 17
22+
// P0767
23+
static_assert(std::is_trivial<std::max_align_t>::value,
24+
"std::is_trivial<std::max_align_t>::value");
25+
#else
2026
static_assert(std::is_pod<std::max_align_t>::value,
2127
"std::is_pod<std::max_align_t>::value");
28+
#endif
2229
static_assert((std::alignment_of<std::max_align_t>::value >=
2330
std::alignment_of<long long>::value),
2431
"std::alignment_of<std::max_align_t>::value >= "

libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_storage.pass.cpp

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ int main()
2121
typedef std::aligned_storage<10, 1 >::type T1;
2222
#if TEST_STD_VER > 11
2323
static_assert(std::is_same<std::aligned_storage_t<10, 1>, T1>::value, "" );
24+
#endif
25+
#if TEST_STD_VER > 17
26+
// P0767
27+
static_assert(std::is_trivial<T1>::value, "" );
28+
#else
29+
static_assert(std::is_pod<T1>::value, "" );
2430
#endif
2531
static_assert(std::alignment_of<T1>::value == 1, "");
2632
static_assert(sizeof(T1) == 10, "");
@@ -29,6 +35,12 @@ int main()
2935
typedef std::aligned_storage<10, 2 >::type T1;
3036
#if TEST_STD_VER > 11
3137
static_assert(std::is_same<std::aligned_storage_t<10, 2>, T1>::value, "" );
38+
#endif
39+
#if TEST_STD_VER > 17
40+
// P0767
41+
static_assert(std::is_trivial<T1>::value, "" );
42+
#else
43+
static_assert(std::is_pod<T1>::value, "" );
3244
#endif
3345
static_assert(std::alignment_of<T1>::value == 2, "");
3446
static_assert(sizeof(T1) == 10, "");
@@ -37,6 +49,12 @@ int main()
3749
typedef std::aligned_storage<10, 4 >::type T1;
3850
#if TEST_STD_VER > 11
3951
static_assert(std::is_same<std::aligned_storage_t<10, 4>, T1>::value, "" );
52+
#endif
53+
#if TEST_STD_VER > 17
54+
// P0767
55+
static_assert(std::is_trivial<T1>::value, "" );
56+
#else
57+
static_assert(std::is_pod<T1>::value, "" );
4058
#endif
4159
static_assert(std::alignment_of<T1>::value == 4, "");
4260
static_assert(sizeof(T1) == 12, "");
@@ -45,6 +63,12 @@ int main()
4563
typedef std::aligned_storage<10, 8 >::type T1;
4664
#if TEST_STD_VER > 11
4765
static_assert(std::is_same<std::aligned_storage_t<10, 8>, T1>::value, "" );
66+
#endif
67+
#if TEST_STD_VER > 17
68+
// P0767
69+
static_assert(std::is_trivial<T1>::value, "" );
70+
#else
71+
static_assert(std::is_pod<T1>::value, "" );
4872
#endif
4973
static_assert(std::alignment_of<T1>::value == 8, "");
5074
static_assert(sizeof(T1) == 16, "");
@@ -53,6 +77,12 @@ int main()
5377
typedef std::aligned_storage<10, 16 >::type T1;
5478
#if TEST_STD_VER > 11
5579
static_assert(std::is_same<std::aligned_storage_t<10, 16>, T1>::value, "" );
80+
#endif
81+
#if TEST_STD_VER > 17
82+
// P0767
83+
static_assert(std::is_trivial<T1>::value, "" );
84+
#else
85+
static_assert(std::is_pod<T1>::value, "" );
5686
#endif
5787
static_assert(std::alignment_of<T1>::value == 16, "");
5888
static_assert(sizeof(T1) == 16, "");
@@ -61,6 +91,12 @@ int main()
6191
typedef std::aligned_storage<10, 32 >::type T1;
6292
#if TEST_STD_VER > 11
6393
static_assert(std::is_same<std::aligned_storage_t<10, 32>, T1>::value, "" );
94+
#endif
95+
#if TEST_STD_VER > 17
96+
// P0767
97+
static_assert(std::is_trivial<T1>::value, "" );
98+
#else
99+
static_assert(std::is_pod<T1>::value, "" );
64100
#endif
65101
static_assert(std::alignment_of<T1>::value == 32, "");
66102
static_assert(sizeof(T1) == 32, "");
@@ -69,6 +105,12 @@ int main()
69105
typedef std::aligned_storage<20, 32 >::type T1;
70106
#if TEST_STD_VER > 11
71107
static_assert(std::is_same<std::aligned_storage_t<20, 32>, T1>::value, "" );
108+
#endif
109+
#if TEST_STD_VER > 17
110+
// P0767
111+
static_assert(std::is_trivial<T1>::value, "" );
112+
#else
113+
static_assert(std::is_pod<T1>::value, "" );
72114
#endif
73115
static_assert(std::alignment_of<T1>::value == 32, "");
74116
static_assert(sizeof(T1) == 32, "");
@@ -77,6 +119,12 @@ int main()
77119
typedef std::aligned_storage<40, 32 >::type T1;
78120
#if TEST_STD_VER > 11
79121
static_assert(std::is_same<std::aligned_storage_t<40, 32>, T1>::value, "" );
122+
#endif
123+
#if TEST_STD_VER > 17
124+
// P0767
125+
static_assert(std::is_trivial<T1>::value, "" );
126+
#else
127+
static_assert(std::is_pod<T1>::value, "" );
80128
#endif
81129
static_assert(std::alignment_of<T1>::value == 32, "");
82130
static_assert(sizeof(T1) == 64, "");
@@ -85,6 +133,12 @@ int main()
85133
typedef std::aligned_storage<12, 16 >::type T1;
86134
#if TEST_STD_VER > 11
87135
static_assert(std::is_same<std::aligned_storage_t<12, 16>, T1>::value, "" );
136+
#endif
137+
#if TEST_STD_VER > 17
138+
// P0767
139+
static_assert(std::is_trivial<T1>::value, "" );
140+
#else
141+
static_assert(std::is_pod<T1>::value, "" );
88142
#endif
89143
static_assert(std::alignment_of<T1>::value == 16, "");
90144
static_assert(sizeof(T1) == 16, "");
@@ -93,6 +147,12 @@ int main()
93147
typedef std::aligned_storage<1>::type T1;
94148
#if TEST_STD_VER > 11
95149
static_assert(std::is_same<std::aligned_storage_t<1>, T1>::value, "" );
150+
#endif
151+
#if TEST_STD_VER > 17
152+
// P0767
153+
static_assert(std::is_trivial<T1>::value, "" );
154+
#else
155+
static_assert(std::is_pod<T1>::value, "" );
96156
#endif
97157
static_assert(std::alignment_of<T1>::value == 1, "");
98158
static_assert(sizeof(T1) == 1, "");
@@ -101,6 +161,12 @@ int main()
101161
typedef std::aligned_storage<2>::type T1;
102162
#if TEST_STD_VER > 11
103163
static_assert(std::is_same<std::aligned_storage_t<2>, T1>::value, "" );
164+
#endif
165+
#if TEST_STD_VER > 17
166+
// P0767
167+
static_assert(std::is_trivial<T1>::value, "" );
168+
#else
169+
static_assert(std::is_pod<T1>::value, "" );
104170
#endif
105171
static_assert(std::alignment_of<T1>::value == 2, "");
106172
static_assert(sizeof(T1) == 2, "");
@@ -109,6 +175,12 @@ int main()
109175
typedef std::aligned_storage<3>::type T1;
110176
#if TEST_STD_VER > 11
111177
static_assert(std::is_same<std::aligned_storage_t<3>, T1>::value, "" );
178+
#endif
179+
#if TEST_STD_VER > 17
180+
// P0767
181+
static_assert(std::is_trivial<T1>::value, "" );
182+
#else
183+
static_assert(std::is_pod<T1>::value, "" );
112184
#endif
113185
static_assert(std::alignment_of<T1>::value == 2, "");
114186
static_assert(sizeof(T1) == 4, "");
@@ -117,6 +189,12 @@ int main()
117189
typedef std::aligned_storage<4>::type T1;
118190
#if TEST_STD_VER > 11
119191
static_assert(std::is_same<std::aligned_storage_t<4>, T1>::value, "" );
192+
#endif
193+
#if TEST_STD_VER > 17
194+
// P0767
195+
static_assert(std::is_trivial<T1>::value, "" );
196+
#else
197+
static_assert(std::is_pod<T1>::value, "" );
120198
#endif
121199
static_assert(std::alignment_of<T1>::value == 4, "");
122200
static_assert(sizeof(T1) == 4, "");
@@ -125,6 +203,12 @@ int main()
125203
typedef std::aligned_storage<5>::type T1;
126204
#if TEST_STD_VER > 11
127205
static_assert(std::is_same<std::aligned_storage_t<5>, T1>::value, "" );
206+
#endif
207+
#if TEST_STD_VER > 17
208+
// P0767
209+
static_assert(std::is_trivial<T1>::value, "" );
210+
#else
211+
static_assert(std::is_pod<T1>::value, "" );
128212
#endif
129213
static_assert(std::alignment_of<T1>::value == 4, "");
130214
static_assert(sizeof(T1) == 8, "");
@@ -141,6 +225,12 @@ int main()
141225
typedef std::aligned_storage<8>::type T1;
142226
#if TEST_STD_VER > 11
143227
static_assert(std::is_same<std::aligned_storage_t<8>, T1>::value, "" );
228+
#endif
229+
#if TEST_STD_VER > 17
230+
// P0767
231+
static_assert(std::is_trivial<T1>::value, "" );
232+
#else
233+
static_assert(std::is_pod<T1>::value, "" );
144234
#endif
145235
static_assert(std::alignment_of<T1>::value == 8, "");
146236
static_assert(sizeof(T1) == 8, "");
@@ -149,6 +239,12 @@ int main()
149239
typedef std::aligned_storage<9>::type T1;
150240
#if TEST_STD_VER > 11
151241
static_assert(std::is_same<std::aligned_storage_t<9>, T1>::value, "" );
242+
#endif
243+
#if TEST_STD_VER > 17
244+
// P0767
245+
static_assert(std::is_trivial<T1>::value, "" );
246+
#else
247+
static_assert(std::is_pod<T1>::value, "" );
152248
#endif
153249
static_assert(std::alignment_of<T1>::value == 8, "");
154250
static_assert(sizeof(T1) == 16, "");
@@ -157,6 +253,12 @@ int main()
157253
typedef std::aligned_storage<15>::type T1;
158254
#if TEST_STD_VER > 11
159255
static_assert(std::is_same<std::aligned_storage_t<15>, T1>::value, "" );
256+
#endif
257+
#if TEST_STD_VER > 17
258+
// P0767
259+
static_assert(std::is_trivial<T1>::value, "" );
260+
#else
261+
static_assert(std::is_pod<T1>::value, "" );
160262
#endif
161263
static_assert(std::alignment_of<T1>::value == 8, "");
162264
static_assert(sizeof(T1) == 16, "");

libcxx/www/cxx2a_status.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h3>Paper Status</h3>
6969
<tr><td><a href="https://wg21.link/P0616R0">P0616R0</a></td><td>LWG</td><td>de-pessimize legacy <numeric> algorithms with std::move</td><td>Albuquerque</td><td></td><td></td></tr>
7070
<tr><td><a href="https://wg21.link/P0653R2">P0653R2</a></td><td>LWG</td><td>Utility to convert a pointer to a raw pointer</td><td>Albuquerque</td><td>Complete</td><td>6.0</td></tr>
7171
<tr><td><a href="https://wg21.link/P0718R2">P0718R2</a></td><td>LWG</td><td>Atomic shared_ptr</td><td>Albuquerque</td><td></td><td></td></tr>
72-
<tr><td><a href="https://wg21.link/P0767R1">P0767R1</a></td><td>CWG</td><td>Deprecate POD</td><td>Albuquerque</td><td></td><td></td></tr>
72+
<tr><td><a href="https://wg21.link/P0767R1">P0767R1</a></td><td>CWG</td><td>Deprecate POD</td><td>Albuquerque</td><td>Complete</td><td>7.0</td></tr>
7373
<tr><td><a href="https://wg21.link/P0768R1">P0768R1</a></td><td>CWG</td><td>Library Support for the Spaceship (Comparison) Operator</td><td>Albuquerque</td><td></td><td></td></tr>
7474
<tr><td><a href="https://wg21.link/P0777R1">P0777R1</a></td><td>LWG</td><td>Treating Unnecessary <tt>decay</tt></td><td>Albuquerque</td><td>Complete</td><td>7.0</td></tr>
7575

@@ -135,7 +135,7 @@ <h3>Library Working group Issues Status</h3>
135135
<!-- <tr><td></td><td></td><td></td><td></td></tr> -->
136136
</table>
137137

138-
<p>Last Updated: 6-Feb-2018</p>
138+
<p>Last Updated: 6-Mar-2018</p>
139139
</div>
140140
</body>
141141
</html>

0 commit comments

Comments
 (0)