Bug 261033

Summary: makeUnique isn't always a substitute for std::make_unique
Product: WebKit Reporter: Jean-Yves Avenard [:jya] <jean-yves.avenard>
Component: Web Template FrameworkAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=261985

Description Jean-Yves Avenard [:jya] 2023-09-01 07:40:13 PDT
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);
 ```
Comment 1 Radar WebKit Bug Importer 2023-09-01 07:40:31 PDT
<rdar://problem/114820281>