mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-20 06:15:09 +08:00
Fix clang warnings about copy elision
When building with clang, I get: /home/emaisin/src/binutils-gdb/gdb/osdata.c:107:9: error: moving a temporary object prevents copy elision [-Werror,-Wpessimizing-move] std::move (std::string (body_text))); ^ /home/emaisin/src/binutils-gdb/gdb/osdata.c:107:9: note: remove std::move call here std::move (std::string (body_text))); ^~~~~~~~~~~ ~ /home/emaisin/src/binutils-gdb/gdb/osdata.c:181:10: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move] return std::move (osdata); ^ /home/emaisin/src/binutils-gdb/gdb/osdata.c:181:10: note: remove std::move call here return std::move (osdata); ^~~~~~~~~~~ ~ Indeed, those two std::move are unnecessary. gdb/ChangeLog: * osdata.c (osdata_end_column, get_osdata): Remove std::move.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
2017-11-23 Simon Marchi <simon.marchi@ericsson.com>
|
||||||
|
|
||||||
|
* osdata.c (osdata_end_column, get_osdata): Remove std::move.
|
||||||
|
|
||||||
2017-11-23 Simon Marchi <simon.marchi@ericsson.com>
|
2017-11-23 Simon Marchi <simon.marchi@ericsson.com>
|
||||||
|
|
||||||
* varobj.c (struct varobj_dynamic) <children_requested_>: Rename
|
* varobj.c (struct varobj_dynamic) <children_requested_>: Rename
|
||||||
|
@ -104,7 +104,7 @@ osdata_end_column (struct gdb_xml_parser *parser,
|
|||||||
osdata_item &item = osdata->items.back ();
|
osdata_item &item = osdata->items.back ();
|
||||||
|
|
||||||
item.columns.emplace_back (std::move (data->property_name),
|
item.columns.emplace_back (std::move (data->property_name),
|
||||||
std::move (std::string (body_text)));
|
std::string (body_text));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The allowed elements and attributes for OS data object.
|
/* The allowed elements and attributes for OS data object.
|
||||||
@ -178,7 +178,7 @@ get_osdata (const char *type)
|
|||||||
if (osdata == NULL)
|
if (osdata == NULL)
|
||||||
error (_("Can not fetch data now."));
|
error (_("Can not fetch data now."));
|
||||||
|
|
||||||
return std::move (osdata);
|
return osdata;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string *
|
const std::string *
|
||||||
|
Reference in New Issue
Block a user