blob: 6535a0a2f20185404d5b89d2d1bdcd6f38f45a76 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Anders Carlssone30572a2009-09-10 23:18:36 +00002struct 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
John McCall7c2342d2010-03-10 11:27:22 +000019struct E; // expected-note {{forward declaration of 'E'}}
Eli Friedmanf43fb722009-11-18 01:28:03 +000020
21void f(C &c, D& d, E& e) {
Anders Carlssone30572a2009-09-10 23:18:36 +000022 c->f(); // expected-error{{use of overloaded operator '->' is ambiguous}}
23 d->f();
Eli Friedmanf43fb722009-11-18 01:28:03 +000024 e->f(); // expected-error{{incomplete definition of type}}
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000025}
Argyrios Kyrtzidisdf8dc5d2011-01-25 23:16:36 +000026
27// rdar://8875304
28namespace rdar8875304 {
29class Point {};
30class Line_Segment{ public: Line_Segment(const Point&){} };
31class Node { public: Point Location(){ Point p; return p; } };
32
33void f()
34{
35 Node** node1;
36 Line_Segment(node1->Location()); // expected-error {{not a structure or union}}
37}
38}