[Webkit-unassigned] [Bug 261033] New: makeUnique isn't always a substitute for std::make_unique

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Sep 1 07:40:13 PDT 2023


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

            Bug ID: 261033
           Summary: makeUnique isn't always a substitute for
                    std::make_unique
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: jean-yves.avenard at apple.com

consider the following:

auto b = std::make_unique<int>(12345);

b is now an unique_ptr<int>, pointing to a single int* with a valid of 12345.

makeUnique<int>(12345>

gives the error:
```
/Users/jyavenard/Work/webkit/OpenSource/WebKitBuild/Debug/usr/local/include/wtf/StdLibExtras.h:595:41: error: type 'int' cannot be used prior to '::' because it has no members
    static_assert(std::is_same<typename T::webkitFastMalloced, int>::value, "T is FastMalloced");
                                        ^
/Users/jyavenard/Work/webkit/OpenSource/Tools/TestWebKitAPI/Tests/WebCore/MediaPromise.cpp:524:17: note: in instantiation of function template specialization 'WTF::makeUnique<int, int>' requested here
    auto test = makeUnique<int>(12345);
 ```

-- 
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/20230901/9f5a0f9b/attachment.htm>


More information about the webkit-unassigned mailing list