Update years in copyright notice for the GDB files.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / member-name.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 struct B
20 {
21 static int b;
22 };
23
24 int B::b = 23;
25
26 struct C : public B
27 {
28 static int x;
29
30 struct inner
31 {
32 static int z;
33 };
34
35 int y;
36
37 C ()
38 {
39 // First breakpoint here
40 y = x + inner::z;
41 }
42
43 int m ()
44 {
45 // Second breakpoint here
46 return x - y;
47 }
48 };
49
50 int C::x = 23;
51 int C::inner::z = 0;
52
53 template<typename T>
54 struct Templ
55 {
56 static int y;
57
58 int m()
59 {
60 // Third breakpoint here
61 return Templ::y;
62 }
63 };
64
65 template<typename T> int Templ<T>::y = 23;
66
67 int main ()
68 {
69 C c;
70 Templ<int> t;
71
72 return c.m() + t.m();
73 }
This page took 0.031038 seconds and 4 git commands to generate.