This is the mail archive of the gdb-testers@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix clang warnings about copy elision


*** 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]