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.
Created attachment 446860 [details] WIP Patch
Created attachment 446865 [details] WIP Patch
Created attachment 446887 [details] WIP Patch
Created attachment 446892 [details] Patch
Comment on attachment 446892 [details] Patch r=me
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].
<rdar://problem/86368668>
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.