It looks like GCC 11 has improved its -Wpessimizing-move warning: [2866/5471] Building CXX object Source/WebCore/CMakeFiles...edSources/unified-sources/UnifiedSource-3c72abbe-58.cpp.o In file included from WTF/Headers/wtf/FastMalloc.h:26, from ../../Source/WebCore/config.h:56, from ../../Source/WebCore/platform/text/TextEncodingRegistry.cpp:27, from WebCore/DerivedSources/unified-sources/UnifiedSource-3c72abbe-58.cpp:1: ../../Source/WebCore/platform/text/LocaleICU.cpp: In member function ‘std::unique_ptr<WTF::Vector<WTF::String> > WebCore::LocaleICU::createLabelVector(void* const*, UDateFormatSymbolType, int32_t, int32_t)’: WTF/Headers/wtf/StdLibExtras.h:563:58: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move] 563 | #define WTFMove(value) std::move<WTF::CheckMoveParameter>(value) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ ../../Source/WebCore/platform/text/LocaleICU.cpp:185:12: note: in expansion of macro ‘WTFMove’ 185 | return WTFMove(labels); | ^~~~~~~ WTF/Headers/wtf/StdLibExtras.h:563:58: note: remove ‘std::move’ call 563 | #define WTFMove(value) std::move<WTF::CheckMoveParameter>(value) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ ../../Source/WebCore/platform/text/LocaleICU.cpp:185:12: note: in expansion of macro ‘WTFMove’ 185 | return WTFMove(labels); | ^~~~~~~ ../../Source/WebCore/platform/text/LocaleICU.cpp: In function ‘std::unique_ptr<WTF::Vector<WTF::String> > WebCore::createFallbackMonthLabels()’: WTF/Headers/wtf/StdLibExtras.h:563:58: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move] 563 | #define WTFMove(value) std::move<WTF::CheckMoveParameter>(value) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ ../../Source/WebCore/platform/text/LocaleICU.cpp:194:12: note: in expansion of macro ‘WTFMove’ 194 | return WTFMove(labels); | ^~~~~~~ WTF/Headers/wtf/StdLibExtras.h:563:58: note: remove ‘std::move’ call 563 | #define WTFMove(value) std::move<WTF::CheckMoveParameter>(value) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ ../../Source/WebCore/platform/text/LocaleICU.cpp:194:12: note: in expansion of macro ‘WTFMove’ 194 | return WTFMove(labels); | ^~~~~~~ ../../Source/WebCore/platform/text/LocaleICU.cpp: In function ‘std::unique_ptr<WTF::Vector<WTF::String> > WebCore::createFallbackAMPMLabels()’: WTF/Headers/wtf/StdLibExtras.h:563:58: warning: moving a local object in a return statement prevents copy elision [-Wpessimizing-move] 563 | #define WTFMove(value) std::move<WTF::CheckMoveParameter>(value) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ ../../Source/WebCore/platform/text/LocaleICU.cpp:216:12: note: in expansion of macro ‘WTFMove’ 216 | return WTFMove(labels); | ^~~~~~~ WTF/Headers/wtf/StdLibExtras.h:563:58: note: remove ‘std::move’ call 563 | #define WTFMove(value) std::move<WTF::CheckMoveParameter>(value) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ ../../Source/WebCore/platform/text/LocaleICU.cpp:216:12: note: in expansion of macro ‘WTFMove’ 216 | return WTFMove(labels); | ^~~~~~~ This case is a little interesting because the return value is a std::unique_ptr, which is noncopyable. I can see why using WTFMove for that would be tempting. But it's not needed for a return value.
Created attachment 427371 [details] Patch
Committed r276813 (237173@main): <https://commits.webkit.org/237173@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 427371 [details].
<rdar://problem/77346730>