[Webkit-unassigned] [Bug 185621] New: Fix -Wreturn-std-move warnings in WebKit found by new clang compiler

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 14 12:39:49 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=185621

            Bug ID: 185621
           Summary: Fix -Wreturn-std-move warnings in WebKit found by new
                    clang compiler
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: ddkilzer at webkit.org
                CC: cdumez at apple.com, dbates at webkit.org

Building WebKit with a newer clang compiler enables a -Wreturn-std-move warning that catches cases where a parameter is passed by rvalue reference (T&& t), but then gets copied when returning that reference by value from the function (return t).

For example, this method:

    String PeerConnectionBackend::filterSDP(String&& sdp) const

generates a warning like this:

    In file included from DerivedSources/WebCore/unified-sources/UnifiedSource139.cpp:5:
    ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: error: local variable 'sdp' will be copied despite being returned by name [-Werror,-Wreturn-std-move]
            return sdp;
                   ^~~
    ./Modules/mediastream/PeerConnectionBackend.cpp:412:16: note: call 'std::move' explicitly to avoid copying
            return sdp;
                   ^~~
                   std::move(sdp)
    1 error generated.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180514/db2264e3/attachment-0001.html>


More information about the webkit-unassigned mailing list