Bug 1162335 - Remove already_AddRefed::MatchNullptr. r?froydnj draft
authorXidorn Quan <me@upsuper.org>
Thu, 01 Jun 2017 15:01:40 +1000
changeset 587487 f0cb52ea2a88fc453a411291ba4fb049665ed665
parent 587486 96e7316d8d813abfdc6295e3f2153fcb77fb9823
child 631283 17823ac366de568af0a672cc21d1d3822b55875e
push id61723
push userxquan@mozilla.com
push dateThu, 01 Jun 2017 05:02:11 +0000
reviewersfroydnj
bugs1162335
milestone55.0a1
Bug 1162335 - Remove already_AddRefed::MatchNullptr. r?froydnj MozReview-Commit-ID: 1hxUm9xdNhK
mfbt/AlreadyAddRefed.h
--- a/mfbt/AlreadyAddRefed.h
+++ b/mfbt/AlreadyAddRefed.h
@@ -62,20 +62,17 @@ struct MOZ_MUST_USE_TYPE MOZ_NON_AUTOABL
    * this behavior through the default constructor.
    *
    * We can revert to simply explicit (T*) and implicit (decltype(nullptr)) when
    * nullptr no longer needs to be emulated to support the ancient b2g compiler.
    * (The () overload could also be removed, if desired, if we changed callers.)
    */
   already_AddRefed() : mRawPtr(nullptr) {}
 
-  // The return and argument types here are arbitrarily selected so no
-  // corresponding member function exists.
-  typedef void (already_AddRefed::* MatchNullptr)(double, float);
-  MOZ_IMPLICIT already_AddRefed(MatchNullptr aRawPtr) : mRawPtr(nullptr) {}
+  MOZ_IMPLICIT already_AddRefed(decltype(nullptr)) : mRawPtr(nullptr) {}
 
   explicit already_AddRefed(T* aRawPtr) : mRawPtr(aRawPtr) {}
 
   // Disallow copy constructor and copy assignment operator: move semantics used instead.
   already_AddRefed(const already_AddRefed<T>& aOther) = delete;
   already_AddRefed<T>& operator=(const already_AddRefed<T>& aOther) = delete;
 
   already_AddRefed(already_AddRefed<T>&& aOther) : mRawPtr(aOther.take()) {}