]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.cp/m-data.cc
This commit was manufactured by cvs2svn to create branch
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.cp / m-data.cc
CommitLineData
71ea1be0
MC
1// 2002-05-13
2
76565097 3enum region { oriental, egyptian, greek, etruscan, roman };
71ea1be0 4
76565097
DC
5// Test one.
6class gnu_obj_1
7{
8protected:
9 typedef region antiquities;
10 const bool test;
11 const int key1;
12 long key2;
71ea1be0 13
76565097 14 antiquities value;
71ea1be0 15
76565097
DC
16public:
17 gnu_obj_1(antiquities a, long l): test(true), key1(5), key2(l), value(a) {}
18};
71ea1be0 19
76565097
DC
20// Test two.
21template<typename T>
22class gnu_obj_2: public virtual gnu_obj_1
23{
24protected:
25 antiquities value_derived;
71ea1be0 26
76565097
DC
27public:
28 gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { }
29};
71ea1be0 30
76565097
DC
31// Test three.
32template<typename T>
33class gnu_obj_3
34{
35protected:
36 typedef region antiquities;
37 gnu_obj_2<int> data;
71ea1be0 38
76565097
DC
39public:
40 gnu_obj_3(antiquities b): data(etruscan) { }
41};
a23b6e6a
DC
42
43int shadow = 0;
44
45class C
46{
47public:
48 C (int x) : shadow (x) {}
49 void marker () {}
50private:
51 int shadow;
52};
71ea1be0
MC
53
54int main()
55{
71ea1be0
MC
56 gnu_obj_1 test1(egyptian, 4589);
57 gnu_obj_2<long> test2(roman);
58 gnu_obj_3<long> test3(greek);
a23b6e6a
DC
59
60 C theC (1); // breakpoint: first-constructs-done
61 theC.marker ();
62
71ea1be0
MC
63 return 0;
64}