Bug 1013065 - Remove bug 65664's NSCAP_DONT_PROVIDE_NONCONST_OPEQ workaround. r=dbaron

This commit is contained in:
Chris Peterson 2014-05-04 23:11:04 -07:00
Родитель 1a1af5241b
Коммит 4d8cb6ff03
5 изменённых файлов: 0 добавлений и 130 удалений

Просмотреть файл

@ -7801,49 +7801,6 @@ AC_SUBST(PROFILE_GEN_LDFLAGS)
AC_SUBST(PROFILE_USE_CFLAGS)
AC_SUBST(PROFILE_USE_LDFLAGS)
AC_LANG_CPLUSPLUS
dnl ========================================================
dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
dnl ========================================================
_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
AC_CACHE_CHECK(for correct overload resolution with const and templates,
ac_nscap_nonconst_opeq_bug,
[AC_TRY_COMPILE([
template <class T>
class Pointer
{
public:
T* myPtr;
};
template <class T, class U>
int operator==(const Pointer<T>& rhs, U* lhs)
{
return rhs.myPtr == lhs;
}
template <class T, class U>
int operator==(const Pointer<T>& rhs, const U* lhs)
{
return rhs.myPtr == lhs;
}
],
[
Pointer<int> foo;
const int* bar;
return foo == bar;
],
ac_nscap_nonconst_opeq_bug="no",
ac_nscap_nonconst_opeq_bug="yes")])
CXXFLAGS="$_SAVE_CXXFLAGS"
if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
fi
fi # ! SKIP_COMPILER_CHECKS
AC_DEFINE(CPP_THROW_NEW, [throw()])

Просмотреть файл

@ -3592,48 +3592,6 @@ AC_SUBST(PROFILE_USE_LDFLAGS)
AC_LANG_CPLUSPLUS
dnl ========================================================
dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
dnl ========================================================
_SAVE_CXXFLAGS=$CXXFLAGS
CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
AC_CACHE_CHECK(for correct overload resolution with const and templates,
ac_nscap_nonconst_opeq_bug,
[AC_TRY_COMPILE([
template <class T>
class Pointer
{
public:
T* myPtr;
};
template <class T, class U>
int operator==(const Pointer<T>& rhs, U* lhs)
{
return rhs.myPtr == lhs;
}
template <class T, class U>
int operator==(const Pointer<T>& rhs, const U* lhs)
{
return rhs.myPtr == lhs;
}
],
[
Pointer<int> foo;
const int* bar;
return foo == bar;
],
ac_nscap_nonconst_opeq_bug="no",
ac_nscap_nonconst_opeq_bug="yes")])
CXXFLAGS="$_SAVE_CXXFLAGS"
if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
fi
dnl ========================================================
dnl Check for tm_zone, tm_gmtoff in struct tm
dnl ========================================================

Просмотреть файл

@ -378,14 +378,6 @@ operator!=( const U* lhs, const nsHtml5RefPtr<T>& rhs )
return static_cast<const U*>(lhs) != static_cast<const T*>(rhs.get());
}
// To avoid ambiguities caused by the presence of builtin |operator==|s
// creating a situation where one of the |operator==| defined above
// has a better conversion for one argument and the builtin has a
// better conversion for the other argument, define additional
// |operator==| without the |const| on the raw pointer.
// See bug 65664 for details.
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
template <class T, class U>
inline
bool
@ -417,7 +409,6 @@ operator!=( U* lhs, const nsHtml5RefPtr<T>& rhs )
{
return const_cast<const U*>(lhs) != static_cast<const T*>(rhs.get());
}
#endif

Просмотреть файл

@ -341,14 +341,6 @@ operator!=(const U* aLhs, const nsAutoPtr<T>& aRhs)
return static_cast<const U*>(aLhs) != static_cast<const T*>(aRhs.get());
}
// To avoid ambiguities caused by the presence of builtin |operator==|s
// creating a situation where one of the |operator==| defined above
// has a better conversion for one argument and the builtin has a
// better conversion for the other argument, define additional
// |operator==| without the |const| on the raw pointer.
// See bug 65664 for details.
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
template <class T, class U>
inline bool
operator==(const nsAutoPtr<T>& aLhs, U* aRhs)
@ -376,7 +368,6 @@ operator!=(U* aLhs, const nsAutoPtr<T>& aRhs)
{
return const_cast<const U*>(aLhs) != static_cast<const T*>(aRhs.get());
}
#endif
@ -725,14 +716,6 @@ operator!=(const U* aLhs, const nsAutoArrayPtr<T>& aRhs)
return static_cast<const U*>(aLhs) != static_cast<const T*>(aRhs.get());
}
// To avoid ambiguities caused by the presence of builtin |operator==|s
// creating a situation where one of the |operator==| defined above
// has a better conversion for one argument and the builtin has a
// better conversion for the other argument, define additional
// |operator==| without the |const| on the raw pointer.
// See bug 65664 for details.
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
template <class T, class U>
inline bool
operator==(const nsAutoArrayPtr<T>& aLhs, U* aRhs)
@ -760,7 +743,6 @@ operator!=(U* aLhs, const nsAutoArrayPtr<T>& aRhs)
{
return const_cast<const U*>(aLhs) != static_cast<const T*>(aRhs.get());
}
#endif
@ -1247,14 +1229,6 @@ operator!=(const U* aLhs, const nsRefPtr<T>& aRhs)
return static_cast<const U*>(aLhs) != static_cast<const T*>(aRhs.get());
}
// To avoid ambiguities caused by the presence of builtin |operator==|s
// creating a situation where one of the |operator==| defined above
// has a better conversion for one argument and the builtin has a
// better conversion for the other argument, define additional
// |operator==| without the |const| on the raw pointer.
// See bug 65664 for details.
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
template <class T, class U>
inline bool
operator==(const nsRefPtr<T>& aLhs, U* aRhs)
@ -1282,7 +1256,6 @@ operator!=(U* aLhs, const nsRefPtr<T>& aRhs)
{
return const_cast<const U*>(aLhs) != static_cast<const T*>(aRhs.get());
}
#endif

Просмотреть файл

@ -1536,14 +1536,6 @@ operator!=( const U* lhs, const nsCOMPtr<T>& rhs )
return lhs != static_cast<const T*>(rhs.get());
}
// To avoid ambiguities caused by the presence of builtin |operator==|s
// creating a situation where one of the |operator==| defined above
// has a better conversion for one argument and the builtin has a
// better conversion for the other argument, define additional
// |operator==| without the |const| on the raw pointer.
// See bug 65664 for details.
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
template <class T, class U>
inline
bool
@ -1575,7 +1567,6 @@ operator!=( U* lhs, const nsCOMPtr<T>& rhs )
{
return const_cast<const U*>(lhs) != static_cast<const T*>(rhs.get());
}
#endif