c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / Wredundant-move12.C
blob192d981ba5e32dd97bd50f033af68cfa711d558f
1 // { dg-do compile { target c++11 } }
2 // { dg-options "-Wredundant-move" }
4 // Define std::move.
5 namespace std {
6   template<typename _Tp>
7     struct remove_reference
8     { typedef _Tp   type; };
10   template<typename _Tp>
11     struct remove_reference<_Tp&>
12     { typedef _Tp   type; };
14   template<typename _Tp>
15     struct remove_reference<_Tp&&>
16     { typedef _Tp   type; };
18   template<typename _Tp>
19     constexpr typename std::remove_reference<_Tp>::type&&
20     move(_Tp&& __t) noexcept
21     { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); }
24 struct S1 {
25      S1();
26      S1(S1 const &) = delete;
27      S1(S1 &&);
28      S1 operator =(S1 const &) = delete;
29      S1 operator =(S1 &&);
32 struct S2 { S2(S1); };
33 S2 f() {
34    S1 s;
35    return { std::move(s) }; // { dg-bogus "redundant move" }