Do not use std::move when assigning an anonymous object to a unique_ptr.

Using std::move forces an extra copy of the object.  These changes fix
-Wpessimizing-move warnings from clang.

gdb/ChangeLog:

	* ada-lang.c (create_excep_cond_exprs): Do not use 'std::move'.
	* ax-gdb.c (agent_eval_command_one): Likewise.
	(agent_eval_command_one): Likewise.
	* breakpoint.c (parse_cond_to_aexpr): Likewise.
	(parse_cmd_to_aexpr): Likewise.
	* dtrace-probe.c (dtrace_process_dof_probe): Likewise.
	* parse.c (parse_expression_for_completion): Likewise.
This commit is contained in:
John Baldwin 2016-11-24 12:01:24 -08:00
parent bbe910e6e1
commit 036e657b48
6 changed files with 23 additions and 14 deletions

View file

@ -2268,7 +2268,7 @@ parse_cond_to_aexpr (CORE_ADDR scope, struct expression *cond)
that may show up. */
TRY
{
aexpr = std::move (gen_eval_for_expr (scope, cond));
aexpr = gen_eval_for_expr (scope, cond);
}
CATCH (ex, RETURN_MASK_ERROR)
@ -2452,9 +2452,9 @@ parse_cmd_to_aexpr (CORE_ADDR scope, char *cmd)
that may show up. */
TRY
{
aexpr = std::move (gen_printf (scope, gdbarch, 0, 0,
format_start, format_end - format_start,
fpieces, nargs, argvec));
aexpr = gen_printf (scope, gdbarch, 0, 0,
format_start, format_end - format_start,
fpieces, nargs, argvec);
}
CATCH (ex, RETURN_MASK_ERROR)
{