https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89660
Bug ID: 89660 Summary: [9 Regression] Rejects-valid error with -Wredundant-move starting with r269427 Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- enum A { B }; namespace std { template <typename T> T &&move(T &&); } struct C; template <typename, typename = C> struct D; struct C { using f = int *; }; template <typename S, typename V> struct D { template <typename T, typename U> D (D<T, U> x) : k(&x.foo ()) {} S &foo (); typename V::f k; }; struct E { D<int> bar (); }; struct F { E e; D<int> baz () { D<F> f = e.bar (); return std::move (*reinterpret_cast<D<int> *> (&f)); } }; is rejected with -Wredundant-move but accepted with -Wno-redundant-move, starting with r269427. Before it has been accepted regardless of whether -W{,no-}redundant-move has been specified or not (but warned about a redundant move).