File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ struct SE1 : S1 { int b;};
1414
1515class P1 {int a;}; // #note-private
1616
17+ union U1 {};
18+ union U2 {int a;};
1719
1820template <typename T>
1921concept is_destructurable = requires {
@@ -33,6 +35,14 @@ static_assert(__builtin_structured_binding_size(SE1) == 1);
3335// expected-error@-1 {{type 'SE1' is not destructurable}} \
3436// expected-error@-1 {{static assertion expression is not an integral constant expression}}
3537
38+ static_assert (__builtin_structured_binding_size(U1) == 0 );
39+ // expected-error@-1 {{type 'U1' is not destructurable}} \
40+ // expected-error@-1 {{static assertion expression is not an integral constant expression}}
41+ static_assert (__builtin_structured_binding_size(U2) == 0 );
42+ // expected-error@-1 {{type 'U2' is not destructurable}} \
43+ // expected-error@-1 {{static assertion expression is not an integral constant expression}}
44+
45+
3646
3747static_assert (__builtin_structured_binding_size(int [0 ]) == 0 );
3848static_assert (__builtin_structured_binding_size(int [1 ]) == 1 );
You can’t perform that action at this time.
0 commit comments