1 Commits

Author SHA1 Message Date
Colby Mchenry 8cba7e5370 fix(cpp): a nullptr argument picks the std::nullptr_t overload, and no call links to a deleted overload (#2554)
A `nullptr` argument fitted any pointer parameter better than a
`std::nullptr_t` one, which counted as a class, so protobuf's
`ptr.reset(nullptr)` on an `Arena::UniquePtr` took `reset(T*)` over
`reset(std::nullptr_t)`. That `reset(T*)` is declared `= delete`, as is
`RepeatedPtrField::Add(const Element&)`, which `field.Add("foo")` reached.
`nullptr` now fits `std::nullptr_t` exactly and a pointer by conversion, and
an overload declared deleted is taken only when every overload is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 07:33:27 +00:00