[LLVM][NVPTX] Add support for griddepcontrol instruction (#123511)
[llvm-project.git] / clang / test / CXX / class.derived / class.member.lookup / p8.cpp
blob78e83c0ab4566c6bb2ba89a54bfbe1d100dbb4bc
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
3 // FIXME: Access control checks
5 namespace PR5820 {
6 struct Base {
7 void Foo();
8 int Member;
9 };
11 struct D1 : public Base {};
12 struct D2 : public Base {};
14 struct Derived : public D1, public D2 {
15 void Inner();
18 void Test() {
19 Derived d;
20 d.D1::Foo();
21 d.D1::Member = 17;
24 void Derived::Inner() {
25 D1::Foo();
26 D1::Member = 42;
27 this->D1::Foo();
28 this->D1::Member = 42;
32 template<typename T>
33 struct BaseT {
34 void Foo(); // expected-note{{found by ambiguous name lookup}}
35 int Member;
38 template<typename T> struct Derived1T : BaseT<T> { };
39 template<typename T> struct Derived2T : BaseT<T> { };
41 template<typename T>
42 struct DerivedT : public Derived1T<T>, public Derived2T<T> {
43 void Inner();
46 template<typename T>
47 void 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>'}}
55 template<typename T>
56 void Test(DerivedT<T> d) {
57 d.template Derived1T<T>::Foo();
58 d.template Derived2T<T>::Member = 17;
59 d.Inner(); // expected-note{{in instantiation}}
62 template void Test(DerivedT<int>);