| 1 |
// PR c++/110064 |
| 2 |
// { dg-do compile { target c++17 } } |
| 3 |
// { dg-options "-Wmissing-field-initializers" } |
| 4 |
|
| 5 |
struct B { }; |
| 6 |
struct D : B { |
| 7 |
int x; |
| 8 |
int y; |
| 9 |
}; |
| 10 |
|
| 11 |
struct E { |
| 12 |
int x; |
| 13 |
int y; |
| 14 |
B z; |
| 15 |
}; |
| 16 |
|
| 17 |
template<typename> struct X { }; |
| 18 |
|
| 19 |
template<typename T> |
| 20 |
struct F { |
| 21 |
int i; |
| 22 |
int j; |
| 23 |
X<T> x; |
| 24 |
}; |
| 25 |
|
| 26 |
int |
| 27 |
main () |
| 28 |
{ |
| 29 |
D d = {.x=1, .y=2}; // { dg-bogus "missing" } |
| 30 |
(void)d; |
| 31 |
E e = {.x=1, .y=2}; // { dg-bogus "missing" } |
| 32 |
(void)e; |
| 33 |
F<int> f = {.i=1, .j=2 }; // { dg-bogus "missing" } |
| 34 |
(void)f; |
| 35 |
} |
| 36 |
|
| 37 |
template<typename T> |
| 38 |
void fn () |
| 39 |
{ |
| 40 |
F<T> f = {.i=1, .j=2 }; // { dg-bogus "missing" } |
| 41 |
(void)f; |
| 42 |
} |
| 43 |
|
| 44 |
void |
| 45 |
g () |
| 46 |
{ |
| 47 |
fn<int> (); |
| 48 |
} |