blob: 8292c7a009f540465f37918745c6373c9c26c9e6 [file] [log] [blame]
Douglas Gregorf1991ea2008-11-07 22:36:19 +00001// RUN: clang -fsyntax-only -verify %s
2struct X {
3 operator bool();
4};
5
6int& f(bool);
7float& f(int);
8
9void f_test(X x) {
10 int& i1 = f(x);
11}
12
13struct Y {
14 operator short();
15 operator float();
16};
17
18void g(int);
19
20void g_test(Y y) {
21 g(y);
Douglas Gregorcb9b9772008-11-10 16:14:15 +000022 short s;
23 s = y;
24}
25
26struct A { };
27struct B : A { };
28
29struct C {
30 operator B&();
31};
32
33// Test reference binding via an lvalue conversion function.
34void h(volatile A&);
35void h_test(C c) {
36 h(c);
Douglas Gregorf1991ea2008-11-07 22:36:19 +000037}