summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/rv-conv3.C
blob: 5f727fcc0d5e1527e29b535f947a1ad4ff00e5e1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// PR c++/90546
// { dg-do link { target c++11 } }

struct Foo { };
void test(const Foo&) {}
Foo f;
struct Bar {
  template <class T> operator T&&();
};
template<> Bar::operator const Foo&&() {
    return static_cast<Foo&&>(f);
}
int main() {
  test(Bar{});
}