Closed Bug 1469155 Opened Last year Closed 7 months ago

|Range::operator bool()| is non-functional because RangedPtr's can't be compared against nullptr

Categories

(Core :: MFBT, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox62 --- wontfix
firefox68 --- fixed

People

(Reporter: anba, Assigned: violet.bugreport)

Details

Attachments

(1 file)

|Range::operator bool()| compares the RangedPtr member against |nullptr| [1], but RangedPtr doesn't have an applicable |operator==()| overload for comparisons against null pointers, so when |Range::operator bool()| is actually called and gets compiled, a compiler error is emitted.

[1] https://searchfox.org/mozilla-central/rev/6eea08365e7386a2b81c044e7cc8a3daa51d8754/mfbt/Range.h#67
[2] https://searchfox.org/mozilla-central/rev/6eea08365e7386a2b81c044e7cc8a3daa51d8754/mfbt/RangedPtr.h#235-256
Assignee: nobody → violet.bugreport

Templated pointer can't match |nullptr|, we should add overloading for
std::nullptr_t specifically to be able to support |nullptr|.

Pushed by violet.bugreport@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/704809991618
Add overloading for std::nullptr_t for RangedPtr equality operator r=froydnj
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.