arrow-operator.cpp revision a5728872c7702ddd09537c95bc3cbd20e1f2fb09
1// RUN: %clang_cc1 -fsyntax-only -verify %s 2struct T { 3 void f(); 4}; 5 6struct A { 7 T* operator->(); // expected-note{{candidate function}} 8}; 9 10struct B { 11 T* operator->(); // expected-note{{candidate function}} 12}; 13 14struct C : A, B { 15}; 16 17struct D : A { }; 18 19struct E; // expected-note {{forward declaration of 'struct E'}} 20 21void f(C &c, D& d, E& e) { 22 c->f(); // expected-error{{use of overloaded operator '->' is ambiguous}} 23 d->f(); 24 e->f(); // expected-error{{incomplete definition of type}} 25} 26