// PR c++/89660 // { dg-do compile { target c++11 } } // { dg-options "-Wredundant-move" } // Define std::move. namespace std { template struct remove_reference { typedef _Tp type; }; template struct remove_reference<_Tp&> { typedef _Tp type; }; template struct remove_reference<_Tp&&> { typedef _Tp type; }; template constexpr typename std::remove_reference<_Tp>::type&& move(_Tp&& __t) noexcept { return static_cast::type&&>(__t); } } template struct D { template D (D x) : k(&x.foo ()) {} S &foo (); int *k; }; D bar (); struct F { D baz () { D f = bar (); return std::move (*reinterpret_cast *> (&f)); // { dg-bogus "redundant move in return statement" } } };