@@ -50,6 +50,14 @@ struct is_constructible {
5050
5151template <typename ... Args>
5252constexpr bool is_constructible_v = __is_constructible(Args...);
53+
54+ template <typename T>
55+ struct is_aggregate {
56+ static constexpr bool value = __is_aggregate(T);
57+ };
58+
59+ template <typename T>
60+ constexpr bool is_aggregate_v = __is_aggregate(T);
5361#endif
5462
5563#ifdef STD2
@@ -88,7 +96,7 @@ constexpr bool is_assignable_v = __is_assignable(T, U);
8896
8997template <typename T>
9098struct __details_is_empty {
91- static constexpr bool value = __is_empty(T);
99+ static constexpr bool value = __is_empty(T);
92100};
93101template <typename T>
94102using is_empty = __details_is_empty<T>;
@@ -97,9 +105,7 @@ constexpr bool is_empty_v = __is_empty(T);
97105
98106template <typename T>
99107struct __details_is_standard_layout {
100- static constexpr bool value = __is_standard_layout(T);
101-
102-
108+ static constexpr bool value = __is_standard_layout(T);
103109};
104110template <typename T>
105111using is_standard_layout = __details_is_standard_layout<T>;
@@ -116,6 +122,17 @@ using is_constructible = __details_is_constructible<Args...>;
116122
117123template <typename ... Args>
118124constexpr bool is_constructible_v = __is_constructible(Args...);
125+
126+ template <typename T>
127+ struct __details_is_aggregate {
128+ static constexpr bool value = __is_aggregate(T);
129+ };
130+
131+ template <typename T>
132+ using is_aggregate = __details_is_aggregate<T>;
133+
134+ template <typename T>
135+ constexpr bool is_aggregate_v = __is_aggregate(T);
119136#endif
120137
121138
@@ -173,12 +190,20 @@ template <typename... Args>
173190struct __details_is_constructible : bool_constant<__is_constructible(Args...)> {};
174191
175192template <typename ... Args>
176- using is_constructible = __details_is_constructible<Args...>;
193+ using is_constructible = __details_is_constructible<Args...>;
177194
178195template <typename ... Args>
179196constexpr bool is_constructible_v = is_constructible<Args...>::value;
180- #endif
181197
198+ template <typename T>
199+ struct __details_is_aggregate : bool_constant<__is_aggregate(T)> {};
200+
201+ template <typename T>
202+ using is_aggregate = __details_is_aggregate<T>;
203+
204+ template <typename T>
205+ constexpr bool is_aggregate_v = is_aggregate<T>::value;
206+ #endif
182207}
183208
184209static_assert (std::is_trivially_relocatable<int >::value);
@@ -248,6 +273,16 @@ static_assert(std::is_constructible_v<void>);
248273// expected-error@-1 {{static assertion failed due to requirement 'std::is_constructible_v<void>'}} \
249274// expected-note@-1 {{because it is a cv void type}}
250275
276+ static_assert (!std::is_aggregate<int >::value);
277+
278+ static_assert (std::is_aggregate<void >::value);
279+ // expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_aggregate<void>::value'}} \
280+ // expected-note@-1 {{'void' is not aggregate}} \
281+ // expected-note@-1 {{because it is a cv void type}}
282+ static_assert (std::is_aggregate_v<void >);
283+ // expected-error@-1 {{static assertion failed due to requirement 'std::is_aggregate_v<void>'}} \
284+ // expected-note@-1 {{'void' is not aggregate}} \
285+ // expected-note@-1 {{because it is a cv void type}}
251286namespace test_namespace {
252287 using namespace std ;
253288 static_assert (is_trivially_relocatable<int &>::value);
@@ -300,6 +335,15 @@ namespace test_namespace {
300335 static_assert (is_constructible_v<void >);
301336 // expected-error@-1 {{static assertion failed due to requirement 'is_constructible_v<void>'}} \
302337 // expected-note@-1 {{because it is a cv void type}}
338+
339+ static_assert (std::is_aggregate<void >::value);
340+ // expected-error-re@-1 {{static assertion failed due to requirement 'std::{{.*}}is_aggregate<void>::value'}} \
341+ // expected-note@-1 {{'void' is not aggregate}} \
342+ // expected-note@-1 {{because it is a cv void type}}
343+ static_assert (std::is_aggregate_v<void >);
344+ // expected-error@-1 {{static assertion failed due to requirement 'std::is_aggregate_v<void>'}} \
345+ // expected-note@-1 {{'void' is not aggregate}} \
346+ // expected-note@-1 {{because it is a cv void type}}
303347}
304348
305349
@@ -337,6 +381,14 @@ concept C3 = std::is_constructible_v<Args...>; // #concept6
337381template <C3 T> void g3 (); // #cand6
338382
339383
384+ template <typename T>
385+ requires std::is_aggregate<T>::value void f5 (); // #cand9
386+
387+ template <typename T>
388+ concept C5 = std::is_aggregate_v<T>; // #concept10
389+
390+ template <C5 T> void g5 (); // #cand10
391+
340392void test () {
341393 f<int &>();
342394 // expected-error@-1 {{no matching function for call to 'f'}} \
@@ -393,6 +445,21 @@ void test() {
393445 // expected-note@#cand6 {{because 'void' does not satisfy 'C3'}} \
394446 // expected-note@#concept6 {{because 'std::is_constructible_v<void>' evaluated to false}} \
395447 // expected-note@#concept6 {{because it is a cv void type}}
448+
449+ f5<void >();
450+ // expected-error@-1 {{no matching function for call to 'f5'}} \
451+ // expected-note@#cand9 {{candidate template ignored: constraints not satisfied [with T = void]}} \
452+ // expected-note-re@#cand9 {{because '{{.*}}is_aggregate<void>::value' evaluated to false}} \
453+ // expected-note@#cand9 {{'void' is not aggregate}} \
454+ // expected-note@#cand9 {{because it is a cv void type}}
455+
456+ g5<void >();
457+ // expected-error@-1 {{no matching function for call to 'g5'}} \
458+ // expected-note@#cand10 {{candidate template ignored: constraints not satisfied [with T = void]}} \
459+ // expected-note@#cand10 {{because 'void' does not satisfy 'C5'}} \
460+ // expected-note@#concept10 {{because 'std::is_aggregate_v<void>' evaluated to false}} \
461+ // expected-note@#concept10 {{'void' is not aggregate}} \
462+ // expected-note@#concept10 {{because it is a cv void type}}
396463}
397464}
398465
0 commit comments