gcc/testsuite/g++.old-deja/g++.brendan/scope2.C
raw| 1 | // { dg-do assemble } |
| 2 | // GROUPS passed scoping |
| 3 | class A |
| 4 | { |
| 5 | public: |
| 6 | A() {} |
| 7 | ~A() {} |
| 8 | virtual void f() {} |
| 9 | }; |
| 10 | |
| 11 | class B : public A |
| 12 | { |
| 13 | public: |
| 14 | B() {} |
| 15 | ~B() {} |
| 16 | virtual void f() {} |
| 17 | }; |
| 18 | |
| 19 | |
| 20 | B GLOBAL_B; |
| 21 | |
| 22 | B& foo() {return GLOBAL_B;} |
| 23 | |
| 24 | int main() |
| 25 | { |
| 26 | // build_scoped_method_call and build_scoped_ref should know how |
| 27 | // to deal with a reference for this |
| 28 | foo().A::f(); |
| 29 | } |