2626# include < locale>
2727#endif
2828
29- #if defined(__POINTER_FIELD_PROTECTION__)
30- constexpr bool pfp_disabled = false ;
31- #else
32- constexpr bool pfp_disabled = true ;
33- #endif
34-
3529static_assert (std::__libcpp_is_trivially_relocatable<char >::value, " " );
3630static_assert (std::__libcpp_is_trivially_relocatable<int >::value, " " );
3731static_assert (std::__libcpp_is_trivially_relocatable<double >::value, " " );
@@ -74,8 +68,8 @@ static_assert(!std::__libcpp_is_trivially_relocatable<NonTrivialDestructor>::val
7468// ----------------------
7569
7670// __split_buffer
77- static_assert (std::__libcpp_is_trivially_relocatable<std::__split_buffer<int > >::value == pfp_disabled , " " );
78- static_assert (std::__libcpp_is_trivially_relocatable<std::__split_buffer<NotTriviallyCopyable> >::value == pfp_disabled , " " );
71+ static_assert (std::__libcpp_is_trivially_relocatable<std::__split_buffer<int > >::value, " " );
72+ static_assert (std::__libcpp_is_trivially_relocatable<std::__split_buffer<NotTriviallyCopyable> >::value, " " );
7973static_assert (!std::__libcpp_is_trivially_relocatable<std::__split_buffer<int , test_allocator<int > > >::value, " " );
8074
8175// standard library types
@@ -88,7 +82,7 @@ static_assert(std::__libcpp_is_trivially_relocatable<std::array<std::unique_ptr<
8882
8983static_assert (std::__libcpp_is_trivially_relocatable<std::array<int , 1 > >::value, " " );
9084static_assert (!std::__libcpp_is_trivially_relocatable<std::array<NotTriviallyCopyable, 1 > >::value, " " );
91- static_assert (std::__libcpp_is_trivially_relocatable<std::array<std::unique_ptr<int >, 1 > >::value == pfp_disabled , " " );
85+ static_assert (std::__libcpp_is_trivially_relocatable<std::array<std::unique_ptr<int >, 1 > >::value, " " );
9286
9387// basic_string
9488#if !__has_feature(address_sanitizer) || !_LIBCPP_INSTRUMENTED_WITH_ASAN
@@ -103,17 +97,17 @@ struct NotTriviallyRelocatableCharTraits : constexpr_char_traits<T> {
10397};
10498
10599static_assert (std::__libcpp_is_trivially_relocatable<
106- std::basic_string<char , std::char_traits<char >, std::allocator<char > > >::value == pfp_disabled ,
100+ std::basic_string<char , std::char_traits<char >, std::allocator<char > > >::value,
107101 " " );
108102static_assert (std::__libcpp_is_trivially_relocatable<
109- std::basic_string<char , NotTriviallyRelocatableCharTraits<char >, std::allocator<char > > >::value == pfp_disabled ,
103+ std::basic_string<char , NotTriviallyRelocatableCharTraits<char >, std::allocator<char > > >::value,
110104 " " );
111105static_assert (std::__libcpp_is_trivially_relocatable<
112- std::basic_string<MyChar, constexpr_char_traits<MyChar>, std::allocator<MyChar> > >::value == pfp_disabled ,
106+ std::basic_string<MyChar, constexpr_char_traits<MyChar>, std::allocator<MyChar> > >::value,
113107 " " );
114108static_assert (
115109 std::__libcpp_is_trivially_relocatable<
116- std::basic_string<MyChar, NotTriviallyRelocatableCharTraits<MyChar>, std::allocator<MyChar> > >::value == pfp_disabled ,
110+ std::basic_string<MyChar, NotTriviallyRelocatableCharTraits<MyChar>, std::allocator<MyChar> > >::value,
117111 " " );
118112static_assert (!std::__libcpp_is_trivially_relocatable<
119113 std::basic_string<char , std::char_traits<char >, test_allocator<char > > >::value,
@@ -125,21 +119,21 @@ static_assert(
125119#endif
126120
127121// deque
128- static_assert (std::__libcpp_is_trivially_relocatable<std::deque<int > >::value == pfp_disabled , " " );
129- static_assert (std::__libcpp_is_trivially_relocatable<std::deque<NotTriviallyCopyable> >::value == pfp_disabled , " " );
122+ static_assert (std::__libcpp_is_trivially_relocatable<std::deque<int > >::value, " " );
123+ static_assert (std::__libcpp_is_trivially_relocatable<std::deque<NotTriviallyCopyable> >::value, " " );
130124static_assert (!std::__libcpp_is_trivially_relocatable<std::deque<int , test_allocator<int > > >::value, " " );
131125
132126// exception_ptr
133127#ifndef _LIBCPP_ABI_MICROSOFT // FIXME: Is this also the case on windows?
134- static_assert (std::__libcpp_is_trivially_relocatable<std::exception_ptr>::value == pfp_disabled , " " );
128+ static_assert (std::__libcpp_is_trivially_relocatable<std::exception_ptr>::value, " " );
135129#endif
136130
137131// expected
138132#if TEST_STD_VER >= 23
139- static_assert (std::__libcpp_is_trivially_relocatable<std::expected<int , int > >::value == pfp_disabled );
140- static_assert (std::__libcpp_is_trivially_relocatable<std::expected<std::unique_ptr<int >, int >>::value == pfp_disabled );
141- static_assert (std::__libcpp_is_trivially_relocatable<std::expected<int , std::unique_ptr<int >>>::value == pfp_disabled );
142- static_assert (std::__libcpp_is_trivially_relocatable<std::expected<std::unique_ptr<int >, std::unique_ptr<int >>>::value == pfp_disabled );
133+ static_assert (std::__libcpp_is_trivially_relocatable<std::expected<int , int > >::value);
134+ static_assert (std::__libcpp_is_trivially_relocatable<std::expected<std::unique_ptr<int >, int >>::value);
135+ static_assert (std::__libcpp_is_trivially_relocatable<std::expected<int , std::unique_ptr<int >>>::value);
136+ static_assert (std::__libcpp_is_trivially_relocatable<std::expected<std::unique_ptr<int >, std::unique_ptr<int >>>::value);
143137
144138static_assert (!std::__libcpp_is_trivially_relocatable<std::expected<int , NotTriviallyCopyable>>::value);
145139static_assert (!std::__libcpp_is_trivially_relocatable<std::expected<NotTriviallyCopyable, int >>::value);
@@ -149,42 +143,42 @@ static_assert(
149143
150144// locale
151145#ifndef TEST_HAS_NO_LOCALIZATION
152- static_assert (std::__libcpp_is_trivially_relocatable<std::locale>::value == pfp_disabled , " " );
146+ static_assert (std::__libcpp_is_trivially_relocatable<std::locale>::value, " " );
153147#endif
154148
155149// optional
156150#if TEST_STD_VER >= 17
157151static_assert (std::__libcpp_is_trivially_relocatable<std::optional<int >>::value, " " );
158152static_assert (!std::__libcpp_is_trivially_relocatable<std::optional<NotTriviallyCopyable>>::value, " " );
159- static_assert (std::__libcpp_is_trivially_relocatable<std::optional<std::unique_ptr<int >>>::value == pfp_disabled , " " );
153+ static_assert (std::__libcpp_is_trivially_relocatable<std::optional<std::unique_ptr<int >>>::value, " " );
160154#endif // TEST_STD_VER >= 17
161155
162156// pair
163- static_assert (std::__libcpp_is_trivially_relocatable<std::pair<int , int > >::value == pfp_disabled , " " );
157+ static_assert (std::__libcpp_is_trivially_relocatable<std::pair<int , int > >::value, " " );
164158static_assert (!std::__libcpp_is_trivially_relocatable<std::pair<NotTriviallyCopyable, int > >::value, " " );
165159static_assert (!std::__libcpp_is_trivially_relocatable<std::pair<int , NotTriviallyCopyable> >::value, " " );
166160static_assert (!std::__libcpp_is_trivially_relocatable<std::pair<NotTriviallyCopyable, NotTriviallyCopyable> >::value,
167161 " " );
168- static_assert (std::__libcpp_is_trivially_relocatable<std::pair<std::unique_ptr<int >, std::unique_ptr<int > > >::value == pfp_disabled ,
162+ static_assert (std::__libcpp_is_trivially_relocatable<std::pair<std::unique_ptr<int >, std::unique_ptr<int > > >::value,
169163 " " );
170164
171165// shared_ptr
172- static_assert (std::__libcpp_is_trivially_relocatable<std::shared_ptr<NotTriviallyCopyable> >::value == pfp_disabled , " " );
166+ static_assert (std::__libcpp_is_trivially_relocatable<std::shared_ptr<NotTriviallyCopyable> >::value, " " );
173167
174168// tuple
175169#if TEST_STD_VER >= 11
176170static_assert (std::__libcpp_is_trivially_relocatable<std::tuple<> >::value, " " );
177171
178- static_assert (std::__libcpp_is_trivially_relocatable<std::tuple<int > >::value == pfp_disabled , " " );
172+ static_assert (std::__libcpp_is_trivially_relocatable<std::tuple<int > >::value, " " );
179173static_assert (!std::__libcpp_is_trivially_relocatable<std::tuple<NotTriviallyCopyable> >::value, " " );
180- static_assert (std::__libcpp_is_trivially_relocatable<std::tuple<std::unique_ptr<int > > >::value == pfp_disabled , " " );
174+ static_assert (std::__libcpp_is_trivially_relocatable<std::tuple<std::unique_ptr<int > > >::value, " " );
181175
182- static_assert (std::__libcpp_is_trivially_relocatable<std::tuple<int , int > >::value == pfp_disabled , " " );
176+ static_assert (std::__libcpp_is_trivially_relocatable<std::tuple<int , int > >::value, " " );
183177static_assert (!std::__libcpp_is_trivially_relocatable<std::tuple<NotTriviallyCopyable, int > >::value, " " );
184178static_assert (!std::__libcpp_is_trivially_relocatable<std::tuple<int , NotTriviallyCopyable> >::value, " " );
185179static_assert (!std::__libcpp_is_trivially_relocatable<std::tuple<NotTriviallyCopyable, NotTriviallyCopyable> >::value,
186180 " " );
187- static_assert (std::__libcpp_is_trivially_relocatable<std::tuple<std::unique_ptr<int >, std::unique_ptr<int > > >::value == pfp_disabled ,
181+ static_assert (std::__libcpp_is_trivially_relocatable<std::tuple<std::unique_ptr<int >, std::unique_ptr<int > > >::value,
188182 " " );
189183#endif // TEST_STD_VER >= 11
190184
@@ -209,9 +203,9 @@ struct NotTriviallyRelocatablePointer {
209203 void operator ()(T*);
210204};
211205
212- static_assert (std::__libcpp_is_trivially_relocatable<std::unique_ptr<int > >::value == pfp_disabled , " " );
213- static_assert (std::__libcpp_is_trivially_relocatable<std::unique_ptr<NotTriviallyCopyable> >::value == pfp_disabled , " " );
214- static_assert (std::__libcpp_is_trivially_relocatable<std::unique_ptr<int []> >::value == pfp_disabled , " " );
206+ static_assert (std::__libcpp_is_trivially_relocatable<std::unique_ptr<int > >::value, " " );
207+ static_assert (std::__libcpp_is_trivially_relocatable<std::unique_ptr<NotTriviallyCopyable> >::value, " " );
208+ static_assert (std::__libcpp_is_trivially_relocatable<std::unique_ptr<int []> >::value, " " );
215209static_assert (!std::__libcpp_is_trivially_relocatable<std::unique_ptr<int , NotTriviallyRelocatableDeleter> >::value,
216210 " " );
217211static_assert (!std::__libcpp_is_trivially_relocatable<std::unique_ptr<int [], NotTriviallyRelocatableDeleter> >::value,
@@ -225,23 +219,23 @@ static_assert(!std::__libcpp_is_trivially_relocatable<std::unique_ptr<int[], Not
225219#if TEST_STD_VER >= 17
226220static_assert (std::__libcpp_is_trivially_relocatable<std::variant<int > >::value, " " );
227221static_assert (!std::__libcpp_is_trivially_relocatable<std::variant<NotTriviallyCopyable> >::value, " " );
228- static_assert (std::__libcpp_is_trivially_relocatable<std::variant<std::unique_ptr<int > > >::value == pfp_disabled , " " );
222+ static_assert (std::__libcpp_is_trivially_relocatable<std::variant<std::unique_ptr<int > > >::value, " " );
229223
230224static_assert (std::__libcpp_is_trivially_relocatable<std::variant<int , int > >::value, " " );
231225static_assert (!std::__libcpp_is_trivially_relocatable<std::variant<NotTriviallyCopyable, int > >::value, " " );
232226static_assert (!std::__libcpp_is_trivially_relocatable<std::variant<int , NotTriviallyCopyable> >::value, " " );
233227static_assert (!std::__libcpp_is_trivially_relocatable<std::variant<NotTriviallyCopyable, NotTriviallyCopyable> >::value,
234228 " " );
235- static_assert (std::__libcpp_is_trivially_relocatable<std::variant<std::unique_ptr<int >, std::unique_ptr<int > > >::value == pfp_disabled ,
229+ static_assert (std::__libcpp_is_trivially_relocatable<std::variant<std::unique_ptr<int >, std::unique_ptr<int > > >::value,
236230 " " );
237231#endif // TEST_STD_VER >= 17
238232
239233// vector
240- static_assert (std::__libcpp_is_trivially_relocatable<std::vector<int > >::value == pfp_disabled , " " );
241- static_assert (std::__libcpp_is_trivially_relocatable<std::vector<NotTriviallyCopyable> >::value == pfp_disabled , " " );
234+ static_assert (std::__libcpp_is_trivially_relocatable<std::vector<int > >::value, " " );
235+ static_assert (std::__libcpp_is_trivially_relocatable<std::vector<NotTriviallyCopyable> >::value, " " );
242236static_assert (!std::__libcpp_is_trivially_relocatable<std::vector<int , test_allocator<int > > >::value, " " );
243237
244238// weak_ptr
245- static_assert (std::__libcpp_is_trivially_relocatable<std::weak_ptr<NotTriviallyCopyable> >::value == pfp_disabled , " " );
239+ static_assert (std::__libcpp_is_trivially_relocatable<std::weak_ptr<NotTriviallyCopyable> >::value, " " );
246240
247241// TODO: Mark all the trivially relocatable STL types as such
0 commit comments