| 1 |
// PR c++/80864 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-options "-Wmissing-braces" } |
| 4 |
|
| 5 |
struct S { |
| 6 |
char c[1]; |
| 7 |
}; |
| 8 |
|
| 9 |
template <typename T> |
| 10 |
void |
| 11 |
fn () |
| 12 |
{ |
| 13 |
constexpr S s1 = S{}; |
| 14 |
constexpr S s2 = S{{}}; |
| 15 |
constexpr S s3 = S{{{}}}; |
| 16 |
constexpr S s4 = {}; |
| 17 |
constexpr S s5 = {{}}; |
| 18 |
constexpr S s6 = {{{}}}; |
| 19 |
constexpr S s7{{}}; |
| 20 |
constexpr S s8{S{}}; |
| 21 |
constexpr S s9{S{{}}}; |
| 22 |
constexpr S s10{S{{{}}}}; |
| 23 |
constexpr S s11 = S(); |
| 24 |
constexpr S s12 = S({}); |
| 25 |
constexpr S s13 = S({{}}); |
| 26 |
constexpr S s14 = {{}}; |
| 27 |
constexpr S s15 = {{{}}}; |
| 28 |
} |
| 29 |
|
| 30 |
void |
| 31 |
foo () |
| 32 |
{ |
| 33 |
fn<int>(); |
| 34 |
} |