]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/g++.dg/cpp0x/overload-conv-3.C
PR c++/86521 - wrong overload resolution with ref-qualifiers.
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / cpp0x / overload-conv-3.C
1 // PR c++/86521
2 // { dg-do compile { target c++11 } }
3
4 template <class T> T&& move (T&);
5
6 struct Dest {
7 Dest() = default;
8 Dest( Dest && ) = default;
9 Dest( Dest const & ) = delete;
10 };
11
12 struct Source {
13 Dest val;
14 operator Dest () && { return move( val ); }
15 operator Dest const & () const & { return val; }
16 };
17
18 int main() {
19 Source x;
20 Dest d(move(x)); // { dg-error "ambiguous" }
21 }