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 T&> ((const struct T &) (const struct T *) t)
> +     and where the std::move does nothing if T does not have a T(const T&&)
> +     constructor, because the argument is const.  It will not use T(T&&)
> +     because that would mean losing the const.  */
> +  else if (TREE_CODE (TREE_TYPE (arg)) == REFERENCE_TYPE

This is TYPE_REF_P so I'll fix that up.

> +        && CP_TYPE_CONST_P (TREE_TYPE (TREE_TYPE (arg))))

Marek

Reply via email to