Bug 1162335 - Remove already_AddRefed::MatchNullptr. r=froydnj
authorXidorn Quan <me@upsuper.org>
Thu, 01 Jun 2017 15:01:40 +1000
changeset 409902 4a2b5682bddf10d2a9a2ee6d7d67f8391553c06b
parent 409901 d0fea6559ec29e78eeb2d353975720d18a592b25
child 409903 cac2fd43de81d44b36396704220996b0c4a39f1a
child 409934 a2b294e575591bf3a25065b2c69c4888c4b6b00d
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1162335
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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()) {}