Update years in copyright notice for the GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / baseenum.cc
1 /* This testcase is part of GDB, the GNU debugger.
2
3 Copyright 2003-2013 Free Software Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 class A
20 {
21 public:
22 enum E {X,Y,Z};
23 };
24
25 class B1 : public A
26 {
27 };
28
29 class B2 : public A
30 {
31 };
32
33 class C : public B1, public B2
34 {
35 public:
36 void test(E e);
37 };
38
39 void C::test(E e)
40 {
41 if (e == X) // breakpoint 1
42 {
43 }
44 }
45
46 namespace N
47 {
48 class A
49 {
50 public:
51 enum E {X, Y, Z};
52 };
53
54 class B1 {};
55 class B2 : public A {};
56
57 class C : public B1, public B2
58 {
59 public:
60 void test (E e);
61 };
62
63 void
64 C::test (E e)
65 {
66 if (e == X) // breakpoint 2
67 {
68 }
69 }
70 }
71
72 int main()
73 {
74 C c;
75 c.test(A::X);
76
77 N::C nc;
78 nc.test (N::A::X);
79 return 0;
80 }
81
This page took 0.034315 seconds and 5 git commands to generate.