WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
261033
makeUnique isn't always a substitute for std::make_unique
https://bugs.webkit.org/show_bug.cgi?id=261033
Summary
makeUnique isn't always a substitute for std::make_unique
Jean-Yves Avenard [:jya]
Reported
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); ```
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2023-09-01 07:40:31 PDT
<
rdar://problem/114820281
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug