Bug 229114

Summary: [WTF] Fix static analyzer warnings for clang tidy bugprone-move-forwarding-reference checker
Product: WebKit Reporter: David Kilzer (:ddkilzer) <ddkilzer>
Component: Web Template FrameworkAssignee: David Kilzer (:ddkilzer) <ddkilzer>
Status: RESOLVED FIXED    
Severity: Normal CC: benjamin, cdumez, cmarcelo, darin, ews-watchlist, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://clang.llvm.org/extra/clang-tidy/checks/bugprone-move-forwarding-reference.html
See Also: https://bugs.webkit.org/show_bug.cgi?id=236181
https://bugs.webkit.org/show_bug.cgi?id=236202
Attachments:
Description Flags
Patch v1 cdumez: review+

Description David Kilzer (:ddkilzer) 2021-08-14 14:35:44 PDT
Fix static analyzer warnings in WTF for clang tidy bugprone-move-forwarding-reference checker.

See:  <https://clang.llvm.org/extra/clang-tidy/checks/bugprone-move-forwarding-reference.html>

In file included from OpenSource/Source/WTF/wtf/AutomaticThread.cpp:27:
In file included from WebKitBuild/usr/local/include/wtf/AutomaticThread.h:29:
In file included from WebKitBuild/usr/local/include/wtf/Condition.h:30:
In file included from WebKitBuild/usr/local/include/wtf/ParkingLot.h:29:
WebKitBuild/usr/local/include/wtf/ScopedLambda.h:128:55: warning: Forwarding reference passed to std::move(), which may unexpectedly cause lvalues to be moved; use std::forward() instead
    return ScopedLambdaFunctor<FunctionType, Functor>(WTFMove(functor));
                                                      ^
In file included from OpenSource/Source/WTF/wtf/AutomaticThread.cpp:26:
In file included from OpenSource/Source/WTF/config.h:31:
In file included from WebKitBuild/usr/local/include/wtf/FastMalloc.h:26:
WebKitBuild/usr/local/include/wtf/StdLibExtras.h:568:24: note: expanded from macro 'WTFMove'
#define WTFMove(value) std::move<WTF::CheckMoveParameter>(value)
                       ^
Comment 1 David Kilzer (:ddkilzer) 2021-08-14 14:46:37 PDT
Created attachment 435551 [details]
Patch v1
Comment 2 EWS 2021-08-19 14:25:21 PDT
Committed r281270 (240695@main): <https://commits.webkit.org/240695@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 435551 [details].
Comment 3 Radar WebKit Bug Importer 2021-08-19 14:26:21 PDT
<rdar://problem/82142002>