c++: constantness of call to function pointer [PR111703]
[official-gcc.git] / gcc / testsuite / g++.dg / pr69338.C
blob8b1351b93d732f239d4fee55ec8a4b9e58829b8e
1 /* { dg-do compile { target c++11 } } */
2 /* { dg-additional-options "-Wno-pedantic" } */
4 struct A { char i, a[]; };
6 void foo()
8   struct A a0 = { 3, "AB" };                /* { dg-error "(non-static)|(initialization)" } */
11 struct A a1 = { 3, "AB" };                  /* { dg-bogus "(non-static)|(initialization)" } */
13 struct A a2 = (struct A){ 3, "AB" };        /* { dg-error "(non-static)|(initialization)" } */
15 struct B1 {
16     A a3;
17     B1 (): a3 { 3, "AB" } { }               /* { dg-error "(non-static)|(initialization)" } */
18 } b1;
20 struct B2 {
21     A a4;
22     B2 (): a4 ((struct A){ 3, "AB" }) { }   /* { dg-error "(non-static)|(initialization)" } */
23 } b2;