run copyright.sh for 2011.
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / namespace1.cc
1 /* Copyright 2003, 2004, 2007, 2008, 2009, 2010, 2011
2 Free Software Foundation, Inc.
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18
19
20 namespace C
21 {
22 class OtherFileClass {
23 public:
24 int z;
25
26 typedef short cOtherFileClassType;
27 typedef long cOtherFileClassType2;
28 static const cOtherFileClassType cOtherFileClassVar = 318;
29 static const cOtherFileClassType2 cOtherFileClassVar2 = 320;
30 cOtherFileClassType cOtherFileClassVar_use ();
31 };
32 OtherFileClass::cOtherFileClassType OtherFileClass::cOtherFileClassVar_use ()
33 {
34 return cOtherFileClassVar + cOtherFileClassVar2;
35 }
36
37 namespace {
38 int cXOtherFile = 29;
39 };
40
41 int cOtherFile = 316;
42
43 void ensureOtherRefs () {
44 // NOTE (2004-04-23, carlton): This function is here only to make
45 // sure that GCC 3.4 outputs debug info for this class.
46 static OtherFileClass *c = new OtherFileClass();
47 c->z = cOtherFile + cXOtherFile;
48 }
49
50 typedef short cOtherFileType;
51 typedef long cOtherFileType2;
52 static const cOtherFileType cOtherFileVar = 319;
53 static const cOtherFileType2 cOtherFileVar2 = 321;
54 cOtherFileType cOtherFileVar_use ()
55 {
56 return cOtherFileVar + cOtherFileVar2;
57 }
58 }
59
60 namespace {
61 int XOtherFile = 317;
62 }
63
64 int ensureOtherRefs ()
65 {
66 C::ensureOtherRefs ();
67 return XOtherFile;
68 }
This page took 0.031476 seconds and 5 git commands to generate.