diff options
Diffstat (limited to 'test/SemaCXX/arrow-operator.cpp')
| -rw-r--r-- | test/SemaCXX/arrow-operator.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/SemaCXX/arrow-operator.cpp b/test/SemaCXX/arrow-operator.cpp new file mode 100644 index 0000000000000..9c46e96afc0be --- /dev/null +++ b/test/SemaCXX/arrow-operator.cpp @@ -0,0 +1,22 @@ +// RUN: clang-cc -fsyntax-only -verify %s +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 { }; + +void f(C &c, D& d) { + c->f(); // expected-error{{use of overloaded operator '->' is ambiguous}} + d->f(); +}
\ No newline at end of file |
