summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/init9.C
blob: 7ceb6410622d45683d11034dc55dfba4169a1b62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// { dg-do run  }
// GROUPS passed initialization
// init file
// From: Richard Speed <speed@cs.montana.edu>
// Date:     Sun, 6 Jun 1993 15:19:41 -0600 (MDT)
// Subject:  excess elements in aggr initzer
// Message-ID: <Pine.3.07.9306061541.A10267-b100000@fubar.cs.montana.edu>

extern "C" int printf (const char *, ...);

class samp {
        int a;
public:
        samp(int n) { a = n; }
        int get_a() { return a; }
};

int main() {
        samp ob[4] [2] = {  // Generated Error
                1, 2,
                3, 4,
                5, 6,
                7, 8,
        };
        int i;

	if (ob[0][0].get_a() == 1 && ob[0][1].get_a() == 2
	    && ob[1][0].get_a() == 3 && ob[1][1].get_a() == 4
	    && ob[2][0].get_a() == 5 && ob[2][1].get_a() == 6
	    && ob[3][0].get_a() == 7 && ob[3][1].get_a() == 8)
	  printf ("PASS\n");
	else
	  { printf ("FAIL\n"); return 1; }

        return 0;
}