summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.benjamin/friend02.C
blob: f6ab601d0b8de645658638ec472fd85a4740a51c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// { dg-do assemble  }
//980610 bkoz
// example 2: ok

class bar;
class foo {
public:
    int func(bar *);
    foo(){}
    ~foo(){}
};

class bar {
  int st;
public:
  bar(){st=12;}
  ~bar(){}
  friend int foo::func(bar *);
};

int foo::func(bar *obj) {
  obj->st++;
  return (obj->st);
}

void test02() {
  foo obj_f;
  bar obj_b;
  
  obj_f.func( &obj_b);
}