Fix clang warnings about copy elision
authorSimon Marchi <simon.marchi@ericsson.com>
Thu, 23 Nov 2017 18:51:50 +0000 (13:51 -0500)
committerSimon Marchi <simon.marchi@ericsson.com>
Thu, 23 Nov 2017 18:52:28 +0000 (13:52 -0500)
commitf45e2a7704c738ba8195a667f910297c4155924e
treef838d2e110d1909570a202c9bfa5b62040e5a032
parentbd046f64a193405f2fef2d5120fab4be25feaa8b
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.
gdb/ChangeLog
gdb/osdata.c