On 7/7/22 22:00, David Malcolm via Gcc-patches wrote: > |libcpp's class label_text stores a char * for a string and a flag saying > whether it owns the buffer. I added this class before we could use C++11, and > so to avoid lots of copying it required an explicit call to > label_text::maybe_free to potentially free the buffer. Now that we can use > C++11, this patch removes label_text::maybe_free in favor of doing the > cleanup in the destructor, and using C++ move semantics to avoid any copying. > This allows lots of messy cleanup code to be eliminated in favor of implicit > destruction (mostly in the analyzer). No functional change intended.|
Hi. I've just noticed Clang complains about the change: /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang/build/libcpp/include/line-map.h:1876:12: warning: moving a temporary object prevents copy elision [-Wpessimizing-move] /home/marxin/BIG/buildbot/buildworker/marxinbox-gcc-clang/build/libcpp/include/line-map.h:1882:12: warning: moving a temporary object prevents copy elision [-Wpessimizing-move] Cheers, Martin