Bug 236459

Summary: [WTF] Fix clang tidy bugprone-move-forwarding-reference static analyzer warnings from WebCore/WebKit
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, ysuzuki
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
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 none

Description David Kilzer (:ddkilzer) 2022-02-10 12:37:53 PST
[WTF] Fix clang tidy bugprone-move-forwarding-reference static analyzer warnings from WebCore/WebKit.

Found by clang static analyzer.
Comment 1 Radar WebKit Bug Importer 2022-02-10 12:38:29 PST
<rdar://problem/88772313>
Comment 2 David Kilzer (:ddkilzer) 2022-02-10 12:39:29 PST
Created attachment 451588 [details]
Patch v1
Comment 3 Darin Adler 2022-02-10 13:56:48 PST
Comment on attachment 451588 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=451588&action=review

> Source/WTF/wtf/IteratorAdaptors.h:110
>  template<typename Transform, typename Iterator>
>  inline TransformIterator<Transform, Iterator> makeTransformIterator(Transform&& transform, Iterator&& iter)
>  {
> -    return TransformIterator<Transform, Iterator>(WTFMove(transform), WTFMove(iter));
> +    return TransformIterator<Transform, Iterator>(std::forward<Transform>(transform), std::forward<Iterator>(iter));
>  }

We should dump this function and take advantage of deduction guides instead. OK to fix it for now, though.
Comment 4 David Kilzer (:ddkilzer) 2022-02-10 20:30:12 PST
Comment on attachment 451588 [details]
Patch v1

Marking cq+ as enough bots have built and tested for this change.
Comment 5 EWS 2022-02-10 21:18:56 PST
Committed r289602 (247115@main): <https://commits.webkit.org/247115@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 451588 [details].