63 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify %s2 3// FIXME: Access control checks4 5namespace PR5820 {6 struct Base {7 void Foo();8 int Member;9 };10 11 struct D1 : public Base {};12 struct D2 : public Base {};13 14 struct Derived : public D1, public D2 {15 void Inner();16 };17 18 void Test() {19 Derived d;20 d.D1::Foo();21 d.D1::Member = 17;22 }23 24 void Derived::Inner() {25 D1::Foo();26 D1::Member = 42;27 this->D1::Foo();28 this->D1::Member = 42;29 }30}31 32template<typename T>33struct BaseT {34 void Foo(); // expected-note{{found by ambiguous name lookup}}35 int Member;36};37 38template<typename T> struct Derived1T : BaseT<T> { };39template<typename T> struct Derived2T : BaseT<T> { };40 41template<typename T>42struct DerivedT : public Derived1T<T>, public Derived2T<T> {43 void Inner();44};45 46template<typename T>47void DerivedT<T>::Inner() {48 Derived1T<T>::Foo();49 Derived2T<T>::Member = 42;50 this->Derived1T<T>::Foo();51 this->Derived2T<T>::Member = 42;52 this->Foo(); // expected-error{{non-static member 'Foo' found in multiple base-class subobjects of type 'BaseT<int>'}}53}54 55template<typename T>56void Test(DerivedT<T> d) {57 d.template Derived1T<T>::Foo();58 d.template Derived2T<T>::Member = 17;59 d.Inner(); // expected-note{{in instantiation}}60}61 62template void Test(DerivedT<int>);63