| 1 |
// { dg-do assemble } |
| 2 |
// g++ 1.36.1 bug 900214_01 |
| 3 |
|
| 4 |
// g++ allows function members of incomplete types to be declared to be |
| 5 |
// friends of other types. |
| 6 |
|
| 7 |
// Cfront 2.0 passes this test. |
| 8 |
|
| 9 |
// keywords: friends, incomplete types, function members |
| 10 |
|
| 11 |
struct A; // { dg-message "" } forward declaration |
| 12 |
|
| 13 |
struct B { |
| 14 |
friend void A::foo(); // { dg-error "" } type A is incomplete |
| 15 |
}; |
| 16 |
|
| 17 |
void A::foo(); /* { dg-error "" } also illegal */ |
| 18 |
|
| 19 |
struct A { |
| 20 |
void foo() {} |
| 21 |
}; |
| 22 |
|
| 23 |
int main () { return 0; } |