aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C
blob: 09fd184f0ab631600f544786bbc0f4a480102978 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// g++ 1.36.1 bug 900214_01

// g++ allows function members of incomplete types to be declared to be
// friends of other types.

// Cfront 2.0 passes this test.

// keywords: friends, incomplete types, function members

struct A;                       // ERROR - forward declaration

struct B {
  friend void A::foo();		// ERROR - type A is incomplete
};

void A::foo();			/* ERROR - also illegal */

struct A {
  void foo() {}
};

int main () { return 0; }