repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
FSF GCC merge 02/23/03
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.benjamin
/
friend01.C
blob
66d42c55490e1e57c2b5201c16a4df608bb12a59
1
// Build don't link:
2
//980610 bkoz
3
// example 1: buggy
4
5
class foo {
6
public:
7
class bar;
8
int func(bar *);
9
class bar {
10
int st;
11
public:
12
bar(){st=12;}
13
~bar(){}
14
friend int foo::func(bar *);
15
};
16
foo(){}
17
~foo(){}
18
};
19
20
21
int foo::func(bar *obj) {
22
obj->st++;
23
return (obj->st);
24
}
25
26
void test02() {
27
foo obj_f;
28
foo::bar obj_b;
29
30
obj_f.func( &obj_b);
31
}