This is the mail archive of the
gdb-testers@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Fix clang warnings about copy elision
- From: sergiodj+buildbot at sergiodj dot net
- To: gdb-testers at sourceware dot org
- Date: Thu, 23 Nov 2017 15:15:41 -0500
- Subject: [binutils-gdb] Fix clang warnings about copy elision
- Authentication-results: sourceware.org; auth=none
*** TEST RESULTS FOR COMMIT f45e2a7704c738ba8195a667f910297c4155924e ***
Author: Simon Marchi <simon.marchi@ericsson.com>
Branch: master
Commit: f45e2a7704c738ba8195a667f910297c4155924e
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.