Bug 229114 - [WTF] Fix static analyzer warnings for clang tidy bugprone-move-forwarding-reference checker
Summary: [WTF] Fix static analyzer warnings for clang tidy bugprone-move-forwarding-re...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL: https://clang.llvm.org/extra/clang-ti...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-08-14 14:35 PDT by David Kilzer (:ddkilzer)
Modified: 2022-02-06 10:08 PST (History)
6 users (show)

See Also:


Attachments
Patch v1 (3.27 KB, patch)
2021-08-14 14:46 PDT, David Kilzer (:ddkilzer)
cdumez: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>