blob: 52d31c0ba07333b799bff6aed8aea4c8a5597afa [file] [log] [blame]
Douglas Gregoreaebc752008-11-06 23:29:22 +00001// RUN: clang -fsyntax-only -verify %s
2class X { };
3
4X operator+(X, X);
5
6void f(X x) {
7 x = x + x;
8}
9
10struct Y;
11struct Z;
12
13struct Y {
14 Y(const Z&);
15};
16
17struct Z {
18 Z(const Y&);
19};
20
21Y operator+(Y, Y);
22bool operator-(Y, Y); // expected-note{{candidate function}}
23bool operator-(Z, Z); // expected-note{{candidate function}}
24
25void g(Y y, Z z) {
26 y = y + z;
27 bool b = y - z; // expected-error{{use of overloaded operator '-' is ambiguous; candidates are:}}
28}
29
30