2 // { dg-prune-output "non-static data member initializers" }
3 // GROUPS passed initialization
7 foo(int dat) { data = dat; }
12 foo f[3] = { 1, 2, 3 }; // works: f[0] = 1, f[1] = 2, f[2] = 3 // { dg-error "" "" { target { ! c++11 } } } ANSI C++ forbids initialization of member f;
17 foo f[3] = { foo(1), foo(2), foo(3) }; // { dg-error "" "" { target { ! c++11 } } } ANSI C++ forbids initialization of member f;
18 // does not compile -- error: field initializer is not constant
23 foo f[3] = { foo(1), foo(2), foo(3) };
24 // standard C++ ... and it works too! :)