opnsense-src/test/SemaCXX/arrow-operator.cpp

26 lines
501 B
C++
Raw Normal View History

2010-01-01 05:34:51 -05:00
// RUN: %clang_cc1 -fsyntax-only -verify %s
2009-10-14 14:03:49 -04:00
struct T {
void f();
};
struct A {
T* operator->(); // expected-note{{candidate function}}
};
struct B {
T* operator->(); // expected-note{{candidate function}}
};
struct C : A, B {
};
struct D : A { };
2009-11-18 09:59:57 -05:00
struct E; // expected-note {{forward declaration of 'struct E'}}
void f(C &c, D& d, E& e) {
2009-10-14 14:03:49 -04:00
c->f(); // expected-error{{use of overloaded operator '->' is ambiguous}}
d->f();
2009-11-18 09:59:57 -05:00
e->f(); // expected-error{{incomplete definition of type}}
}