1 // PR c++/95164
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wmissing-braces" }
4
5 struct H {
6 int a;
7 };
8
9 struct X : H { };
10
11 struct I {
12 int c;
13 H b;
14 };
15 struct E { I d; };
16 void foo(E);
17
18 template<int N>
fn()19 void fn ()
20 {
21 int a = 42;
22 int &k = a;
23
24 foo({1, {H{k}}}); // { dg-warning "missing braces around initializer for .I." }
25 foo({1, {X{k}}}); // { dg-warning "missing braces around initializer for .I." }
26
27 foo({{1, {k}}});
28 foo({{1, {N}}});
29
30 foo({{1, H{k}}});
31 foo({{1, H{N}}});
32 foo({{1, X{k}}});
33 foo({{1, X{N}}});
34
35 foo({{1, {H{k}}}});
36 foo({{1, {H{N}}}});
37 foo({{1, {X{k}}}});
38 foo({{1, {X{N}}}});
39 }
40