Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Anders Carlsson | e30572a | 2009-09-10 23:18:36 +0000 | [diff] [blame] | 2 | struct T { |
| 3 | void f(); |
| 4 | }; |
| 5 | |
| 6 | struct A { |
| 7 | T* operator->(); // expected-note{{candidate function}} |
| 8 | }; |
| 9 | |
| 10 | struct B { |
| 11 | T* operator->(); // expected-note{{candidate function}} |
| 12 | }; |
| 13 | |
| 14 | struct C : A, B { |
| 15 | }; |
| 16 | |
| 17 | struct D : A { }; |
| 18 | |
John McCall | 7c2342d | 2010-03-10 11:27:22 +0000 | [diff] [blame] | 19 | struct E; // expected-note {{forward declaration of 'E'}} |
Eli Friedman | f43fb72 | 2009-11-18 01:28:03 +0000 | [diff] [blame] | 20 | |
| 21 | void f(C &c, D& d, E& e) { |
Anders Carlsson | e30572a | 2009-09-10 23:18:36 +0000 | [diff] [blame] | 22 | c->f(); // expected-error{{use of overloaded operator '->' is ambiguous}} |
| 23 | d->f(); |
Eli Friedman | f43fb72 | 2009-11-18 01:28:03 +0000 | [diff] [blame] | 24 | e->f(); // expected-error{{incomplete definition of type}} |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 25 | } |
Argyrios Kyrtzidis | df8dc5d | 2011-01-25 23:16:36 +0000 | [diff] [blame] | 26 | |
| 27 | // rdar://8875304 |
| 28 | namespace rdar8875304 { |
| 29 | class Point {}; |
| 30 | class Line_Segment{ public: Line_Segment(const Point&){} }; |
| 31 | class Node { public: Point Location(){ Point p; return p; } }; |
| 32 | |
| 33 | void f() |
| 34 | { |
| 35 | Node** node1; |
| 36 | Line_Segment(node1->Location()); // expected-error {{not a structure or union}} |
| 37 | } |
| 38 | } |