gcc/testsuite/g++.dg/cpp2a/paren-init30.C
raw| 1 | // PR c++/92812 |
| 2 | // P1975R0 |
| 3 | // { dg-do compile { target c++20 } } |
| 4 | |
| 5 | struct S1 { |
| 6 | int i; |
| 7 | int j; |
| 8 | }; |
| 9 | |
| 10 | struct S2 { |
| 11 | S1 s[4]; |
| 12 | }; |
| 13 | |
| 14 | struct S3 { |
| 15 | S2 s2; |
| 16 | }; |
| 17 | |
| 18 | void |
| 19 | f () |
| 20 | { |
| 21 | // Brace elision not allowed. |
| 22 | auto s3 = static_cast<S3>(1); // { dg-error "could not convert" } |
| 23 | } |