gcc/testsuite/g++.dg/cpp0x/initlist109.C
raw| 1 | // PR c++/80864 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | // { dg-options "-Wmissing-braces" } |
| 4 | |
| 5 | struct S {}; |
| 6 | struct A { S s[1]; }; |
| 7 | |
| 8 | template <typename> |
| 9 | struct R { static constexpr auto h = A{S{}}; }; // { dg-warning "missing braces" } |
| 10 | |
| 11 | template <typename> |
| 12 | struct R2 { static constexpr auto h = A{{S{}}}; }; |
| 13 | |
| 14 | A foo = R<int>::h; |
| 15 | A foo2 = R2<int>::h; |