https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85043

--- Comment #14 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I've encountered this bug with:

struct S { };
void g(S&&);

void
f (S&& arg)
{
  g(S(arg)); // warning: useless cast to type 'struct S'
}

which doesn't compile without the cast, because then "arg" is an lvalue that
cannot bind to S&&.

I'd like to disable then warning when a class is cast to a non-reference type.

Reply via email to