Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/paren-init13.C

raw
1 // PR c++/91363 - P0960R3: Parenthesized initialization of aggregates.
2 // { dg-do compile { target c++20 } }
3
4 struct X { int a, b; };
5 struct Y { X x; };
6
7 void
8 f()
9 {
10 // This is ok...
11 Y y1{{1, 2}};
12 Y y2({1, 2});
13 // ...but Y y((1,2)) is not the same as Y y{{1,2}}. (1, 2) is a
14 // COMPOUND_EXPR.
15 Y y3((1, 2)); // { dg-error "could not convert" }
16 }