Example #1
0
    void fun()
    {
        A::sub a;

        a.x();
    
        a.sub::x();
        a.base::x();

        a.B::base::x(); // expected-error{{use of undeclared identifier 'B'}}

        a.A::sub::x();
        a.A::B::base::x();

        a.bad::x(); // expected-error{{'bad::x' is not a member of class 'A::sub'}}

        a->foo();
        a->member::foo();
        a->A::member::foo();
    }
Example #2
0
    void fun()
    {
        A::sub a;

        a.x();
    
        a.sub::x();
        a.base::x();

        a.B::base::x(); // expected-error{{use of undeclared identifier 'B'}}

        a.A::sub::x();
        a.A::B::base::x();

        a.bad::x(); // expected-error{{type 'bad' is not a direct or virtual base of ''A::sub''}}

        a->foo();
        a->member::foo();
        a->A::member::foo();
    }