Bug 236459 - [WTF] Fix clang tidy bugprone-move-forwarding-reference static analyzer warnings from WebCore/WebKit
Summary: [WTF] Fix clang tidy bugprone-move-forwarding-reference static analyzer warni...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-10 12:37 PST by David Kilzer (:ddkilzer)
Modified: 2022-02-10 21:19 PST (History)
7 users (show)

See Also:


Attachments
Patch v1 (2.01 KB, patch)
2022-02-10 12:39 PST, David Kilzer (:ddkilzer)
no flags 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) 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].