Bug 234192

Summary: Add a std::nullptr_t constructor for RefPtr
Product: WebKit Reporter: Don Olmstead <don.olmstead>
Component: Web Template FrameworkAssignee: Don Olmstead <don.olmstead>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, benjamin, cdumez, cfleizach, cmarcelo, darin, dmazzoni, eric.carlson, ews-watchlist, glenn, jcraig, jdiggs, jer.noble, kondapallykalyan, luiz, philipj, samuel_white, sergio, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP Patch
ews-feeder: commit-queue-
WIP Patch
ews-feeder: commit-queue-
WIP Patch
none
Patch none

Description Don Olmstead 2021-12-10 21:08:18 PST
Both std::unique_ptr and std::shared_ptr have a constexpr default constructor and a constexpr constructor for std::nullptr_t. Do the same with RefPtr.
Comment 1 Don Olmstead 2021-12-10 21:14:57 PST Comment hidden (obsolete)
Comment 2 Don Olmstead 2021-12-10 23:13:16 PST Comment hidden (obsolete)
Comment 3 Don Olmstead 2021-12-11 08:34:02 PST Comment hidden (obsolete)
Comment 4 Don Olmstead 2021-12-11 09:31:04 PST
Created attachment 446892 [details]
Patch
Comment 5 Yusuke Suzuki 2021-12-11 12:09:30 PST
Comment on attachment 446892 [details]
Patch

r=me
Comment 6 EWS 2021-12-11 12:50:17 PST
Committed r286917 (245143@main): <https://commits.webkit.org/245143@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 446892 [details].
Comment 7 Radar WebKit Bug Importer 2021-12-11 12:51:18 PST
<rdar://problem/86368668>
Comment 8 Darin Adler 2021-12-14 20:36:45 PST
I don’t think this patch actually optimizes any generated code because I’m pretty sure the old constructor got inlined and collapsed to just zero-initialization. But I like that this catches us using 0 by accident, and that it's constexpr.