Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/Wredundant-move11.C

raw
1 // PR c++/67906
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-Wall -Wextra" }
4
5 // Define std::move.
6 namespace std {
7 template<typename _Tp>
8 struct remove_reference
9 { typedef _Tp type; };
10
11 template<typename _Tp>
12 struct remove_reference<_Tp&>
13 { typedef _Tp type; };
14
15 template<typename _Tp>
16 struct remove_reference<_Tp&&>
17 { typedef _Tp type; };
18
19 template<typename _Tp>
20 constexpr typename std::remove_reference<_Tp>::type&&
21 move(_Tp&& __t) noexcept
22 { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); }
23 }
24
25 struct X {
26 X() { }
27 X(const X&) { }
28 X(const X&&) { }
29 };
30
31 const X x;
32 const X y = std::move(x);