1 // { dg-do run }
2 // GROUPS passed initialization
3 // init file
4 // From: Richard Speed <speed@cs.montana.edu>
5 // Date: Sun, 6 Jun 1993 15:19:41 -0600 (MDT)
6 // Subject: excess elements in aggr initzer
7 // Message-ID: <Pine.3.07.9306061541.A10267-b100000@fubar.cs.montana.edu>
8
9 extern "C" int printf (const char *, ...);
10
11 class samp {
12 int a;
13 public:
samp(int n)14 samp(int n) { a = n; }
get_a()15 int get_a() { return a; }
16 };
17
main()18 int main() {
19 samp ob[4] [2] = { // Generated Error
20 1, 2,
21 3, 4,
22 5, 6,
23 7, 8,
24 };
25 int i;
26
27 if (ob[0][0].get_a() == 1 && ob[0][1].get_a() == 2
28 && ob[1][0].get_a() == 3 && ob[1][1].get_a() == 4
29 && ob[2][0].get_a() == 5 && ob[2][1].get_a() == 6
30 && ob[3][0].get_a() == 7 && ob[3][1].get_a() == 8)
31 printf ("PASS\n");
32 else
33 { printf ("FAIL\n"); return 1; }
34
35 return 0;
36 }
37