diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C')
-rwxr-xr-x | gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C new file mode 100755 index 0000000..3aac764 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900214_01.C @@ -0,0 +1,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; + +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; } |