On Mon, Aug 15, 2022 at 03:43:38PM -0400, Jason Merrill wrote:
> On 8/8/22 13:27, Marek Polacek wrote:
> > This is to warn about this:
> >
> > T f5(const T t)
> > {
> >return std::move(t); // { dg-warning "redundant move" }
> > }
> >
> > where OR fails because there's no T(const T&&) (or it's
On 8/8/22 13:27, Marek Polacek wrote:
On Sat, Aug 06, 2022 at 03:58:13PM -0800, Jason Merrill wrote:
On 8/6/22 11:13, Marek Polacek wrote:
In this PR, Jon suggested extending the -Wredundant-move warning
to warn when the user is moving a const object as in:
struct T { };
T f(const T&
On Mon, Aug 08, 2022 at 04:27:10PM -0400, Marek Polacek wrote:
> + /* Also try to warn about redundant std::move in code such as
> + T f (const T& t)
> + {
> + return std::move(t);
> + }
> +for which EXPR will be something like
> + *std::move ((const struct T &) (const
On Sat, Aug 06, 2022 at 03:58:13PM -0800, Jason Merrill wrote:
> On 8/6/22 11:13, Marek Polacek wrote:
> > In this PR, Jon suggested extending the -Wredundant-move warning
> > to warn when the user is moving a const object as in:
> >
> >struct T { };
> >
> >T f(const T& t)
> >{
> >