OSDN Git Service

2012-12-15 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / cpp0x / overload-conv-1.C
1 // { dg-options "--std=c++0x" }
2 // { dg-do link }
3
4 struct S {};
5
6 struct T
7 {
8   operator S() { return S(); }
9 };
10
11 struct U
12 {
13   operator S&() { return *static_cast<S*>(0); }
14 };
15
16 void f(const S&);
17 void f(S&&) {}
18
19 void g(const S&) {}
20 void g(S&&);
21
22 int main()
23 {
24   T t;
25   f(t);
26
27   U u;
28   g(u);
29 }