diff --git a/layout/base/ArenaRefPtr.h b/layout/base/ArenaRefPtr.h index bc8ecaa70d37..741fd5f4c95a 100644 --- a/layout/base/ArenaRefPtr.h +++ b/layout/base/ArenaRefPtr.h @@ -97,15 +97,10 @@ public: ~ArenaRefPtr() { assign(nullptr); } -#ifdef MOZ_HAVE_REF_QUALIFIERS operator T*() const & { return get(); } operator T*() const && = delete; explicit operator bool() const { return !!mPtr; } bool operator!() const { return !mPtr; } -#else - operator T*() const { return get(); } -#endif - T* operator->() const { return mPtr.operator->(); } T& operator*() const { return *get(); } diff --git a/mfbt/Attributes.h b/mfbt/Attributes.h index df6172f31b5a..47ab277e2bb0 100644 --- a/mfbt/Attributes.h +++ b/mfbt/Attributes.h @@ -551,22 +551,6 @@ #define MOZ_RAII MOZ_NON_TEMPORARY_CLASS MOZ_STACK_CLASS -/* - * MOZ_HAVE_REF_QUALIFIERS is defined for compilers that support C++11's rvalue - * qualifier, "&&". - */ -#if defined(_MSC_VER) && _MSC_VER >= 1900 -# define MOZ_HAVE_REF_QUALIFIERS -#elif defined(__clang__) -// All supported Clang versions -# define MOZ_HAVE_REF_QUALIFIERS -#elif defined(__GNUC__) -# include "mozilla/Compiler.h" -# if MOZ_GCC_VERSION_AT_LEAST(4, 8, 1) -# define MOZ_HAVE_REF_QUALIFIERS -# endif -#endif - #endif /* __cplusplus */ /** diff --git a/mfbt/RefPtr.h b/mfbt/RefPtr.h index bfa8f6e02a68..2de5a74c3b46 100644 --- a/mfbt/RefPtr.h +++ b/mfbt/RefPtr.h @@ -283,10 +283,7 @@ public: return const_cast(mRawPtr); } - operator T*() const -#ifdef MOZ_HAVE_REF_QUALIFIERS - & -#endif + operator T*() const & /* ...makes an |RefPtr| act like its underlying raw pointer type whenever it is used in a context where a raw pointer is expected. It is this operator @@ -299,7 +296,6 @@ public: return get(); } -#ifdef MOZ_HAVE_REF_QUALIFIERS // Don't allow implicit conversion of temporary RefPtr to raw pointer, // because the refcount might be one and the pointer will immediately become // invalid. @@ -310,7 +306,6 @@ public: // operator bool instead of the deleted operator T*? explicit operator bool() const { return !!mRawPtr; } bool operator!() const { return !mRawPtr; } -#endif T* operator->() const MOZ_NO_ADDREF_RELEASE_ON_RETURN diff --git a/xpcom/glue/nsCOMPtr.h b/xpcom/glue/nsCOMPtr.h index 373f55cbb9d5..7505550d8ae9 100644 --- a/xpcom/glue/nsCOMPtr.h +++ b/xpcom/glue/nsCOMPtr.h @@ -747,13 +747,8 @@ public: // // Prefer the implicit use of this operator to calling |get()|, except where // necessary to resolve ambiguity. - operator T*() const -#ifdef MOZ_HAVE_REF_QUALIFIERS - & -#endif - { return get(); } + operator T*() const & { return get(); } -#ifdef MOZ_HAVE_REF_QUALIFIERS // Don't allow implicit conversion of temporary nsCOMPtr to raw pointer, // because the refcount might be one and the pointer will immediately become // invalid. @@ -761,7 +756,6 @@ public: // Needed to avoid the deleted operator above explicit operator bool() const { return !!mRawPtr; } -#endif T* operator->() const MOZ_NO_ADDREF_RELEASE_ON_RETURN { @@ -1468,5 +1462,4 @@ RefPtr::operator=(const nsCOMPtr_helper& aHelper) return *this; } - #endif // !defined(nsCOMPtr_h___)