Bug 680625 part 0: Remove checks and workarounds for 20th century compilers. r=ted
authorMatheus Kerschbaum <matjk7@gmail.com>
Fri, 26 Aug 2011 00:35:13 +0100
changeset 77296 706c0a4feec232daab369c002d8af05c2e2fe2b9
parent 77295 a80fe3a6586f0b4123b562731dfa5e4afb7d7ba9
child 77297 3d4b14bd24e3c7527b7dcc941bb49f0a879c8584
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs680625
milestone9.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 680625 part 0: Remove checks and workarounds for 20th century compilers. r=ted
configure.in
js/src/configure.in
xpcom/base/nscore.h
xpcom/tests/TestCOMPtr.cpp
xpcom/tests/TestRefPtr.cpp
xpcom/xpcom-config.h.in
--- a/configure.in
+++ b/configure.in
@@ -3816,52 +3816,16 @@ if test "$GNU_CC"; then
       TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
       HAVE_GCC3_ABI=1
   else
       TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc2}"
   fi
 fi
 AC_SUBST(HAVE_GCC3_ABI)
 
-
-AC_CACHE_CHECK(for C++ \"explicit\" keyword,
-               ac_cv_cpp_explicit,
-               [AC_TRY_COMPILE(class X {
-                               public: explicit X(int i) : i_(i) {}
-                               private: int i_;
-                               };,
-                               X x(3);,
-                               ac_cv_cpp_explicit=yes,
-                               ac_cv_cpp_explicit=no)])
-if test "$ac_cv_cpp_explicit" = yes ; then
-   AC_DEFINE(HAVE_CPP_EXPLICIT)
-fi
-
-AC_CACHE_CHECK(for C++ \"typename\" keyword,
-               ac_cv_cpp_typename,
-               [AC_TRY_COMPILE(class param {
-                               public:
-                                   typedef unsigned long num_type;
-                               };
-
-                               template <class T> class tplt {
-                               public:
-                                   typedef typename T::num_type t_num_type;
-                                   t_num_type foo(typename T::num_type num) {
-                                       return num;
-                                   }
-                               };,
-                               tplt<param> A;
-                               A.foo(0);,
-                               ac_cv_cpp_typename=yes,
-                               ac_cv_cpp_typename=no)])
-if test "$ac_cv_cpp_typename" = yes ; then
-   AC_DEFINE(HAVE_CPP_TYPENAME)
-fi
-
 dnl Check for support of modern template specialization syntax
 dnl Test code and requirement from scc@netscape.com.
 dnl Autoconf cut-and-paste job by waterson@netscape.com
 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
                ac_cv_cpp_modern_specialize_template_syntax,
                [AC_TRY_COMPILE(template <class T> struct X { int a; };
                                class Y {};
                                template <> struct X<Y> { double a; };,
@@ -3881,50 +3845,16 @@ AC_CACHE_CHECK(whether partial template 
                                template <class T> class Foo<T*> {};,
                                return 0;,
                                ac_cv_cpp_partial_specialization=yes,
                                ac_cv_cpp_partial_specialization=no)])
 if test "$ac_cv_cpp_partial_specialization" = yes ; then
   AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
 fi
 
-dnl Some compilers have limited support for operators with templates;
-dnl specifically, it is necessary to define derived operators when a base
-dnl class's operator declaration should suffice.
-AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
-               ac_cv_need_derived_template_operators,
-               [AC_TRY_COMPILE([template <class T> class Base { };
-                                template <class T>
-                                Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
-                                template <class T> class Derived : public Base<T> { };],
-                               [Derived<char> a, b;
-                                Base<char> c = a + b;
-                                return 0;],
-                               ac_cv_need_derived_template_operators=no,
-                               ac_cv_need_derived_template_operators=yes)])
-if test "$ac_cv_need_derived_template_operators" = yes ; then
-  AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
-fi
-
-
-dnl Some compilers have trouble detecting that a template class
-dnl that derives from another template is actually an instance
-dnl of the base class. This test checks for that.
-AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
-               ac_cv_need_cpp_template_cast_to_base,
-               [AC_TRY_COMPILE([template <class T> class Base { };
-                                template <class T> class Derived : public Base<T> { };
-                                template <class T> int foo(const Base<T>&) { return 0; }],
-                               [Derived<char> bar; return foo(bar);],
-                               ac_cv_need_cpp_template_cast_to_base=no,
-                               ac_cv_need_cpp_template_cast_to_base=yes)])
-if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
-  AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
-fi
-
 dnl Some compilers have trouble resolving the ambiguity between two
 dnl functions whose arguments differ only by cv-qualifications.
 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
                ac_cv_can_resolve_const_ambiguity,
                [AC_TRY_COMPILE([
                                 template <class T> class ptrClass {
                                   public: T* ptr;
                                 };
@@ -3941,59 +3871,16 @@ AC_CACHE_CHECK(whether the compiler can 
                                [ ptrClass<int> i;
                                  a(&i); ],
                                ac_cv_can_resolve_const_ambiguity=yes,
                                ac_cv_can_resolve_const_ambiguity=no)])
 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
   AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
 fi
 
-dnl
-dnl We don't do exceptions on unix.  The only reason this used to be here
-dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses 
-dnl exceptions.  But, we turn exceptions off by default and this test breaks.
-dnl So im commenting this out until someone writes some artificial 
-dnl intelligence to detect not only if the compiler has exceptions, but if 
-dnl they are enabled as well.
-dnl 
-dnl AC_CACHE_CHECK(for C++ \"exceptions\",
-dnl                ac_cv_cpp_exceptions,
-dnl                [AC_TRY_COMPILE(class X { public: X() {} };
-dnl                                static void F() { throw X(); },
-dnl                                try { F(); } catch(X & e) { },
-dnl                                ac_cv_cpp_exceptions=yes,
-dnl                                ac_cv_cpp_exceptions=no)])
-dnl if test $ac_cv_cpp_exceptions = yes ; then
-dnl    AC_DEFINE(HAVE_CPP_EXCEPTIONS)
-dnl fi
-
-dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
-dnl supports it well enough to allow us to use it to change access, but not
-dnl to resolve ambiguity. The next two tests determine how well the |using|
-dnl keyword is supported.
-dnl
-dnl Check to see if we can change access with |using|.  Test both a
-dnl legal and an illegal example.
-AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
-               ac_cv_cpp_access_changing_using2,
-               [AC_TRY_COMPILE(
-                   class A { protected: int foo() { return 0; } };
-                   class B : public A { public: using A::foo; };,
-                   B b; return b.foo();,
-                   [AC_TRY_COMPILE(
-                       class A { public: int foo() { return 1; } };
-                       class B : public A { private: using A::foo; };,
-                       B b; return b.foo();,
-                       ac_cv_cpp_access_changing_using2=no,
-                       ac_cv_cpp_access_changing_using2=yes)],
-                   ac_cv_cpp_access_changing_using2=no)])
-if test "$ac_cv_cpp_access_changing_using2" = yes ; then
-   AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
-fi
-
 dnl Check to see if we can resolve ambiguity with |using|.
 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
                ac_cv_cpp_ambiguity_resolving_using,
                [AC_TRY_COMPILE(class X { 
                                  public: int go(const X&) {return 3;}
                                          int jo(const X&) {return 3;}
                                };
                                class Y : public X {
@@ -4004,58 +3891,16 @@ AC_CACHE_CHECK(whether the C++ \"using\"
                                };,
                                X x; Y y; y.jo(x);,
                                ac_cv_cpp_ambiguity_resolving_using=yes,
                                ac_cv_cpp_ambiguity_resolving_using=no)])
 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
    AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
 fi
 
-dnl Check to see if the |std| namespace is supported. If so, we'll want
-dnl to qualify any standard library calls with "std::" to ensure that
-dnl those functions can be resolved.
-AC_CACHE_CHECK(for \"std::\" namespace,
-               ac_cv_cpp_namespace_std,
-               [AC_TRY_COMPILE([#include <algorithm>],
-                               [return std::min(0, 1);],
-                               ac_cv_cpp_namespace_std=yes,
-                               ac_cv_cpp_namespace_std=no)])
-if test "$ac_cv_cpp_namespace_std" = yes ; then
-   AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
-fi
-
-dnl Older compilers are overly ambitious with respect to using the standard
-dnl template library's |operator!=()| when |operator==()| is defined. In
-dnl which case, defining |operator!=()| in addition to |operator==()| causes
-dnl ambiguity at compile-time. This test checks for that case.
-AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
-               ac_cv_cpp_unambiguous_std_notequal,
-               [AC_TRY_COMPILE([#include <algorithm>
-                                struct T1 {};
-                                int operator==(const T1&, const T1&) { return 0; }
-                                int operator!=(const T1&, const T1&) { return 0; }],
-                               [T1 a,b; return a != b;],
-                               ac_cv_cpp_unambiguous_std_notequal=unambiguous,
-                               ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
-if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
-  AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
-fi
-
-
-AC_CACHE_CHECK(for C++ reinterpret_cast,
-               ac_cv_cpp_reinterpret_cast,
-               [AC_TRY_COMPILE(struct X { int i; };
-                               struct Y { int i; };,
-                               X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
-                               ac_cv_cpp_reinterpret_cast=yes,
-                               ac_cv_cpp_reinterpret_cast=no)])
-if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
-   AC_DEFINE(HAVE_CPP_NEW_CASTS)
-fi
-
 dnl See if a dynamic_cast to void* gives the most derived object.
 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
                ac_cv_cpp_dynamic_cast_void_ptr,
                [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
                             class Y { int j; public: virtual ~Y() { } };
                             class Z : public X, public Y { int k; };
 
                             int main() {
@@ -7923,48 +7768,16 @@ if test "$_PEDANTIC"; then
         ;;
     yes)
         AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic.  Reconfigure using --disable-pedantic. ])
         ;;
     esac
 fi
 
 dnl ========================================================
-dnl Test for correct temporary object destruction order
-dnl ========================================================
-dnl We want to make sure the compiler follows the C++ spec here as 
-dnl xpcom and the string classes depend on it (bug 235381).
-if test -z "$CROSS_COMPILE"; then
-AC_MSG_CHECKING([for correct temporary object destruction order])
-AC_TRY_RUN([ class A {
-             public:  A(int& x) : mValue(x) {}
-                      ~A() { mValue--; }
-                      operator char**() { return 0; }
-             private:  int& mValue;
-             };
-             void func(char **arg) {}
-             int m=2;
-             void test() {
-                  func(A(m));
-                  if (m==1) m = 0;
-             }
-             int main() {
-                 test();
-                 return(m);
-             }
-             ],
-     result="yes", result="no", result="maybe")
-AC_MSG_RESULT([$result])
-
-if test "$result" = "no"; then
-    AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
-fi
-fi
-
-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,
@@ -9144,29 +8957,23 @@ AC_SUBST(ac_configure_args)
 
 dnl Spit out some output
 dnl ========================================================
 
 dnl The following defines are used by xpcom
 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
 CPP_THROW_NEW
 HAVE_CPP_2BYTE_WCHAR_T
-HAVE_CPP_ACCESS_CHANGING_USING
 HAVE_CPP_AMBIGUITY_RESOLVING_USING
 HAVE_CPP_BOOL
 HAVE_CPP_CHAR16_T
 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
-HAVE_CPP_EXPLICIT
 HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
-HAVE_CPP_NAMESPACE_STD
-HAVE_CPP_NEW_CASTS
 HAVE_CPP_PARTIAL_SPECIALIZATION
 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
-HAVE_CPP_TYPENAME
-HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
 HAVE_STATVFS
 NEED_CPP_UNUSED_IMPLEMENTATIONS
 NEW_H
 HAVE_GETPAGESIZE
 HAVE_ICONV
 HAVE_ICONV_WITH_CONST_INPUT
 HAVE_MBRTOWC
 HAVE_SYS_MOUNT_H
--- a/js/src/configure.in
+++ b/js/src/configure.in
@@ -3736,52 +3736,16 @@ if test "$GNU_CC"; then
       TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
       HAVE_GCC3_ABI=1
   else
       TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc2}"
   fi
 fi
 AC_SUBST(HAVE_GCC3_ABI)
 
-
-AC_CACHE_CHECK(for C++ \"explicit\" keyword,
-               ac_cv_cpp_explicit,
-               [AC_TRY_COMPILE(class X {
-                               public: explicit X(int i) : i_(i) {}
-                               private: int i_;
-                               };,
-                               X x(3);,
-                               ac_cv_cpp_explicit=yes,
-                               ac_cv_cpp_explicit=no)])
-if test "$ac_cv_cpp_explicit" = yes ; then
-   AC_DEFINE(HAVE_CPP_EXPLICIT)
-fi
-
-AC_CACHE_CHECK(for C++ \"typename\" keyword,
-               ac_cv_cpp_typename,
-               [AC_TRY_COMPILE(class param {
-                               public:
-                                   typedef unsigned long num_type;
-                               };
-
-                               template <class T> class tplt {
-                               public:
-                                   typedef typename T::num_type t_num_type;
-                                   t_num_type foo(typename T::num_type num) {
-                                       return num;
-                                   }
-                               };,
-                               tplt<param> A;
-                               A.foo(0);,
-                               ac_cv_cpp_typename=yes,
-                               ac_cv_cpp_typename=no)])
-if test "$ac_cv_cpp_typename" = yes ; then
-   AC_DEFINE(HAVE_CPP_TYPENAME)
-fi
-
 dnl Check for support of modern template specialization syntax
 dnl Test code and requirement from scc@netscape.com.
 dnl Autoconf cut-and-paste job by waterson@netscape.com
 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
                ac_cv_cpp_modern_specialize_template_syntax,
                [AC_TRY_COMPILE(template <class T> struct X { int a; };
                                class Y {};
                                template <> struct X<Y> { double a; };,
@@ -3801,50 +3765,16 @@ AC_CACHE_CHECK(whether partial template 
                                template <class T> class Foo<T*> {};,
                                return 0;,
                                ac_cv_cpp_partial_specialization=yes,
                                ac_cv_cpp_partial_specialization=no)])
 if test "$ac_cv_cpp_partial_specialization" = yes ; then
   AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
 fi
 
-dnl Some compilers have limited support for operators with templates;
-dnl specifically, it is necessary to define derived operators when a base
-dnl class's operator declaration should suffice.
-AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
-               ac_cv_need_derived_template_operators,
-               [AC_TRY_COMPILE([template <class T> class Base { };
-                                template <class T>
-                                Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
-                                template <class T> class Derived : public Base<T> { };],
-                               [Derived<char> a, b;
-                                Base<char> c = a + b;
-                                return 0;],
-                               ac_cv_need_derived_template_operators=no,
-                               ac_cv_need_derived_template_operators=yes)])
-if test "$ac_cv_need_derived_template_operators" = yes ; then
-  AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
-fi
-
-
-dnl Some compilers have trouble detecting that a template class
-dnl that derives from another template is actually an instance
-dnl of the base class. This test checks for that.
-AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
-               ac_cv_need_cpp_template_cast_to_base,
-               [AC_TRY_COMPILE([template <class T> class Base { };
-                                template <class T> class Derived : public Base<T> { };
-                                template <class T> int foo(const Base<T>&) { return 0; }],
-                               [Derived<char> bar; return foo(bar);],
-                               ac_cv_need_cpp_template_cast_to_base=no,
-                               ac_cv_need_cpp_template_cast_to_base=yes)])
-if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
-  AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
-fi
-
 dnl Some compilers have trouble resolving the ambiguity between two
 dnl functions whose arguments differ only by cv-qualifications.
 AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
                ac_cv_can_resolve_const_ambiguity,
                [AC_TRY_COMPILE([
                                 template <class T> class ptrClass {
                                   public: T* ptr;
                                 };
@@ -3861,59 +3791,16 @@ AC_CACHE_CHECK(whether the compiler can 
                                [ ptrClass<int> i;
                                  a(&i); ],
                                ac_cv_can_resolve_const_ambiguity=yes,
                                ac_cv_can_resolve_const_ambiguity=no)])
 if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
   AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
 fi
 
-dnl
-dnl We don't do exceptions on unix.  The only reason this used to be here
-dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses 
-dnl exceptions.  But, we turn exceptions off by default and this test breaks.
-dnl So im commenting this out until someone writes some artificial 
-dnl intelligence to detect not only if the compiler has exceptions, but if 
-dnl they are enabled as well.
-dnl 
-dnl AC_CACHE_CHECK(for C++ \"exceptions\",
-dnl                ac_cv_cpp_exceptions,
-dnl                [AC_TRY_COMPILE(class X { public: X() {} };
-dnl                                static void F() { throw X(); },
-dnl                                try { F(); } catch(X & e) { },
-dnl                                ac_cv_cpp_exceptions=yes,
-dnl                                ac_cv_cpp_exceptions=no)])
-dnl if test $ac_cv_cpp_exceptions = yes ; then
-dnl    AC_DEFINE(HAVE_CPP_EXCEPTIONS)
-dnl fi
-
-dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
-dnl supports it well enough to allow us to use it to change access, but not
-dnl to resolve ambiguity. The next two tests determine how well the |using|
-dnl keyword is supported.
-dnl
-dnl Check to see if we can change access with |using|.  Test both a
-dnl legal and an illegal example.
-AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
-               ac_cv_cpp_access_changing_using2,
-               [AC_TRY_COMPILE(
-                   class A { protected: int foo() { return 0; } };
-                   class B : public A { public: using A::foo; };,
-                   B b; return b.foo();,
-                   [AC_TRY_COMPILE(
-                       class A { public: int foo() { return 1; } };
-                       class B : public A { private: using A::foo; };,
-                       B b; return b.foo();,
-                       ac_cv_cpp_access_changing_using2=no,
-                       ac_cv_cpp_access_changing_using2=yes)],
-                   ac_cv_cpp_access_changing_using2=no)])
-if test "$ac_cv_cpp_access_changing_using2" = yes ; then
-   AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
-fi
-
 dnl Check to see if we can resolve ambiguity with |using|.
 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
                ac_cv_cpp_ambiguity_resolving_using,
                [AC_TRY_COMPILE(class X { 
                                  public: int go(const X&) {return 3;}
                                          int jo(const X&) {return 3;}
                                };
                                class Y : public X {
@@ -3924,58 +3811,16 @@ AC_CACHE_CHECK(whether the C++ \"using\"
                                };,
                                X x; Y y; y.jo(x);,
                                ac_cv_cpp_ambiguity_resolving_using=yes,
                                ac_cv_cpp_ambiguity_resolving_using=no)])
 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
    AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
 fi
 
-dnl Check to see if the |std| namespace is supported. If so, we'll want
-dnl to qualify any standard library calls with "std::" to ensure that
-dnl those functions can be resolved.
-AC_CACHE_CHECK(for \"std::\" namespace,
-               ac_cv_cpp_namespace_std,
-               [AC_TRY_COMPILE([#include <algorithm>],
-                               [return std::min(0, 1);],
-                               ac_cv_cpp_namespace_std=yes,
-                               ac_cv_cpp_namespace_std=no)])
-if test "$ac_cv_cpp_namespace_std" = yes ; then
-   AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
-fi
-
-dnl Older compilers are overly ambitious with respect to using the standard
-dnl template library's |operator!=()| when |operator==()| is defined. In
-dnl which case, defining |operator!=()| in addition to |operator==()| causes
-dnl ambiguity at compile-time. This test checks for that case.
-AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
-               ac_cv_cpp_unambiguous_std_notequal,
-               [AC_TRY_COMPILE([#include <algorithm>
-                                struct T1 {};
-                                int operator==(const T1&, const T1&) { return 0; }
-                                int operator!=(const T1&, const T1&) { return 0; }],
-                               [T1 a,b; return a != b;],
-                               ac_cv_cpp_unambiguous_std_notequal=unambiguous,
-                               ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
-if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
-  AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
-fi
-
-
-AC_CACHE_CHECK(for C++ reinterpret_cast,
-               ac_cv_cpp_reinterpret_cast,
-               [AC_TRY_COMPILE(struct X { int i; };
-                               struct Y { int i; };,
-                               X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
-                               ac_cv_cpp_reinterpret_cast=yes,
-                               ac_cv_cpp_reinterpret_cast=no)])
-if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
-   AC_DEFINE(HAVE_CPP_NEW_CASTS)
-fi
-
 dnl See if a dynamic_cast to void* gives the most derived object.
 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
                ac_cv_cpp_dynamic_cast_void_ptr,
                [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
                             class Y { int j; public: virtual ~Y() { } };
                             class Z : public X, public Y { int k; };
 
                             int main() {
@@ -5170,46 +5015,16 @@ if test "$_PEDANTIC"; then
         ;;
     yes)
         AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic.  Reconfigure using --disable-pedantic. ])
         ;;
     esac
 fi
 
 dnl ========================================================
-dnl Test for correct temporary object destruction order
-dnl ========================================================
-dnl We want to make sure the compiler follows the C++ spec here as 
-dnl xpcom and the string classes depend on it (bug 235381).
-AC_MSG_CHECKING([for correct temporary object destruction order])
-AC_TRY_RUN([ class A {
-             public:  A(int& x) : mValue(x) {}
-                      ~A() { mValue--; }
-                      operator char**() { return 0; }
-             private:  int& mValue;
-             };
-             void func(char **arg) {}
-             int m=2;
-             void test() {
-                  func(A(m));
-                  if (m==1) m = 0;
-             }
-             int main() {
-                 test();
-                 return(m);
-             }
-             ],
-     result="yes", result="no", result="maybe")
-AC_MSG_RESULT([$result])
-
-if test "$result" = "no"; then
-    AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
-fi
-
-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,
--- a/xpcom/base/nscore.h
+++ b/xpcom/base/nscore.h
@@ -394,52 +394,32 @@ typedef PRUint32 nsrefcnt;
     just omit it for specialization.
 
     Need to add an autoconf test for this.
   */
 
   /* under VC++ (Windows), we don't have autoconf yet */
 #if defined(_MSC_VER) && (_MSC_VER>=1100)
   #define HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
-
-  #define HAVE_CPP_EXPLICIT
-  #define HAVE_CPP_TYPENAME
-  #define HAVE_CPP_ACCESS_CHANGING_USING
-
-  #define HAVE_CPP_NAMESPACE_STD
-  #define HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
   #define HAVE_CPP_2BYTE_WCHAR_T
 #endif
 
 #ifndef __PRUNICHAR__
 #define __PRUNICHAR__
   /* For now, don't use wchar_t on Unix because it breaks the Netscape
    * commercial build.  When this is fixed there will be no need for the
    * |reinterpret_cast| in nsLiteralString.h either.
    */
   #if defined(HAVE_CPP_2BYTE_WCHAR_T) && defined(NS_WIN32)
     typedef wchar_t PRUnichar;
   #else
     typedef PRUint16 PRUnichar;
   #endif
 #endif
 
-  /*
-    If the compiler doesn't support |explicit|, we'll just make it go
-    away, trusting that the builds under compilers that do have it
-    will keep us on the straight and narrow.
-  */
-#ifndef HAVE_CPP_EXPLICIT
-  #define explicit
-#endif
-
-#ifndef HAVE_CPP_TYPENAME
-  #define typename
-#endif
-
 #ifdef HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
   #define NS_SPECIALIZE_TEMPLATE  template <>
 #else
   #define NS_SPECIALIZE_TEMPLATE
 #endif
 
 /*
  * Use these macros to do 64bit safe pointer conversions.
--- a/xpcom/tests/TestCOMPtr.cpp
+++ b/xpcom/tests/TestCOMPtr.cpp
@@ -36,25 +36,16 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include <assert.h>
 #include <stdio.h>
 #include "nsCOMPtr.h"
 #include "nsISupports.h"
 
-#ifdef HAVE_CPP_NEW_CASTS
-  #define STATIC_CAST(T,x)  static_cast<T>(x)
-  #define REINTERPRET_CAST(T,x) reinterpret_cast<T>(x)
-#else
-  #define STATIC_CAST(T,x)  ((T)(x))
-  #define REINTERPRET_CAST(T,x) ((T)(x))
-#endif
-
-
 #define NS_IFOO_IID \
 { 0x6f7652e0,  0xee43, 0x11d1, \
  { 0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
 
 class IFoo : public nsISupports
   {
 		public:
 			NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFOO_IID)
@@ -128,86 +119,86 @@ IFoo::print_totals()
            total_constructions_, total_destructions_);
   }
 
 IFoo::IFoo()
     : refcount_(0)
   {
     ++total_constructions_;
     printf("  new IFoo@%p [#%d]\n",
-           STATIC_CAST(void*, this), total_constructions_);
+           static_cast<void*>(this), total_constructions_);
   }
 
 IFoo::~IFoo()
   {
     ++total_destructions_;
     printf("IFoo@%p::~IFoo() [#%d]\n",
-           STATIC_CAST(void*, this), total_destructions_);
+           static_cast<void*>(this), total_destructions_);
   }
 
 nsrefcnt
 IFoo::AddRef()
   {
     ++refcount_;
     printf("IFoo@%p::AddRef(), refcount --> %d\n", 
-           STATIC_CAST(void*, this), refcount_);
+           static_cast<void*>(this), refcount_);
     return refcount_;
   }
 
 nsrefcnt
 IFoo::Release()
   {
     int newcount = --refcount_;
     if ( newcount == 0 )
       printf(">>");
 
     printf("IFoo@%p::Release(), refcount --> %d\n",
-           STATIC_CAST(void*, this), refcount_);
+           static_cast<void*>(this), refcount_);
 
     if ( newcount == 0 )
       {
-        printf("  delete IFoo@%p\n", STATIC_CAST(void*, this));
-        printf("<<IFoo@%p::Release()\n", STATIC_CAST(void*, this));
+        printf("  delete IFoo@%p\n", static_cast<void*>(this));
+        printf("<<IFoo@%p::Release()\n", static_cast<void*>(this));
         delete this;
       }
 
     return newcount;
   }
 
 nsresult
 IFoo::QueryInterface( const nsIID& aIID, void** aResult )
 	{
-    printf("IFoo@%p::QueryInterface()\n", STATIC_CAST(void*, this));
+    printf("IFoo@%p::QueryInterface()\n", static_cast<void*>(this));
 		nsISupports* rawPtr = 0;
 		nsresult status = NS_OK;
 
 		if ( aIID.Equals(GetIID()) )
 			rawPtr = this;
 		else
 			{
 				nsID iid_of_ISupports = NS_ISUPPORTS_IID;
 				if ( aIID.Equals(iid_of_ISupports) )
-					rawPtr = STATIC_CAST(nsISupports*, this);
+					rawPtr = static_cast<nsISupports*>(this);
 				else
 					status = NS_ERROR_NO_INTERFACE;
 			}
 
 		NS_IF_ADDREF(rawPtr);
 		*aResult = rawPtr;
 
 		return status;
 	}
 
 nsresult
 CreateIFoo( void** result )
     // a typical factory function (that calls AddRef)
   {
     printf(">>CreateIFoo() --> ");
     IFoo* foop = new IFoo;
-    printf("IFoo@%p\n", STATIC_CAST(void*, foop));
+    printf("IFoo@%p\n", static_cast<void*>(foop));
 
     foop->AddRef();
     *result = foop;
 
     printf("<<CreateIFoo()\n");
     return 0;
   }
 
@@ -249,40 +240,40 @@ class IBar : public IFoo
 
       NS_IMETHOD QueryInterface( const nsIID&, void** );
   };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(IBar, NS_IBAR_IID)
 
 IBar::IBar()
   {
-    printf("  new IBar@%p\n", STATIC_CAST(void*, this));
+    printf("  new IBar@%p\n", static_cast<void*>(this));
   }
 
 IBar::~IBar()
   {
-    printf("IBar@%p::~IBar()\n", STATIC_CAST(void*, this));
+    printf("IBar@%p::~IBar()\n", static_cast<void*>(this));
   }
 
 nsresult
 IBar::QueryInterface( const nsID& aIID, void** aResult )
 	{
-    printf("IBar@%p::QueryInterface()\n", STATIC_CAST(void*, this));
+    printf("IBar@%p::QueryInterface()\n", static_cast<void*>(this));
 		nsISupports* rawPtr = 0;
 		nsresult status = NS_OK;
 
 		if ( aIID.Equals(GetIID()) )
 			rawPtr = this;
 		else if ( aIID.Equals(NS_GET_IID(IFoo)) )
-			rawPtr = STATIC_CAST(IFoo*, this);
+			rawPtr = static_cast<IFoo*>(this);
 		else
 			{
 				nsID iid_of_ISupports = NS_ISUPPORTS_IID;
 				if ( aIID.Equals(iid_of_ISupports) )
-					rawPtr = STATIC_CAST(nsISupports*, this);
+					rawPtr = static_cast<nsISupports*>(this);
 				else
 					status = NS_ERROR_NO_INTERFACE;
 			}
 
 		NS_IF_ADDREF(rawPtr);
 		*aResult = rawPtr;
 
 		return status;
@@ -291,17 +282,17 @@ IBar::QueryInterface( const nsID& aIID, 
 
 
 nsresult
 CreateIBar( void** result )
     // a typical factory function (that calls AddRef)
   {
     printf(">>CreateIBar() --> ");
     IBar* barp = new IBar;
-    printf("IBar@%p\n", STATIC_CAST(void*, barp));
+    printf("IBar@%p\n", static_cast<void*>(barp));
 
     barp->AddRef();
     *result = barp;
 
     printf("<<CreateIBar()\n");
     return 0;
   }
 
@@ -320,22 +311,22 @@ AnISupportsPtrPtrContext( nsISupports** 
 	{
 	}
 
 static
 nsresult
 TestBloat_Raw_Unsafe()
 	{
 		IBar* barP = 0;
-		nsresult result = CreateIBar(REINTERPRET_CAST(void**, &barP));
+		nsresult result = CreateIBar(reinterpret_cast<void**>(&barP));
 
 		if ( barP )
 			{
 				IFoo* fooP = 0;
-				if ( NS_SUCCEEDED( result = barP->QueryInterface(NS_GET_IID(IFoo), REINTERPRET_CAST(void**, &fooP)) ) )
+				if ( NS_SUCCEEDED( result = barP->QueryInterface(NS_GET_IID(IFoo), reinterpret_cast<void**>(&fooP)) ) )
 					{
 						fooP->print_totals();
 						NS_RELEASE(fooP);
 					}
 
 				NS_RELEASE(barP);
 			}
 
@@ -386,20 +377,20 @@ main()
 
         // [Shouldn't compile] Is it a compile time error to try to |Release| be hand?
       //foop->Release();
 
 				// [Shouldn't compile] Is it a compile time error to try to |delete| an |nsCOMPtr|?
 			//delete foop;
 
       printf("\n### Test  3: can you |AddRef| if you must?\n");
-      STATIC_CAST(IFoo*, foop)->AddRef();
+      static_cast<IFoo*>(foop)->AddRef();
 
       printf("\n### Test  4: can you |Release| if you must?\n");
-      STATIC_CAST(IFoo*, foop)->Release();
+      static_cast<IFoo*>(foop)->Release();
 
       printf("\n### Test  5: will a |nsCOMPtr| |Release| when it goes out of scope?\n");
     }
 
     {
       printf("\n### Test  6: will a |nsCOMPtr| call the correct destructor?\n");
       nsCOMPtr<IFoo> foop( do_QueryInterface(new IBar) );
     }
--- a/xpcom/tests/TestRefPtr.cpp
+++ b/xpcom/tests/TestRefPtr.cpp
@@ -37,25 +37,16 @@
  * ***** END LICENSE BLOCK ***** */
 
 #include <assert.h>
 #include <stdio.h>
 #include "nsCOMPtr.h"
 #include "nsAutoPtr.h"
 #include "nsISupports.h"
 
-#ifdef HAVE_CPP_NEW_CASTS
-  #define STATIC_CAST(T,x)  static_cast<T>(x)
-  #define REINTERPRET_CAST(T,x) reinterpret_cast<T>(x)
-#else
-  #define STATIC_CAST(T,x)  ((T)(x))
-  #define REINTERPRET_CAST(T,x) ((T)(x))
-#endif
-
-
 #define NS_FOO_IID \
 { 0x6f7652e0,  0xee43, 0x11d1, \
  { 0x9c, 0xc3, 0x00, 0x60, 0x08, 0x8c, 0xa6, 0xb3 } }
 
 class Foo : public nsISupports
   {
 		public:
 			NS_DECLARE_STATIC_IID_ACCESSOR(NS_FOO_IID)
@@ -129,86 +120,86 @@ Foo::print_totals()
            total_constructions_, total_destructions_);
   }
 
 Foo::Foo()
     : refcount_(0)
   {
     ++total_constructions_;
     printf("  new Foo@%p [#%d]\n",
-           STATIC_CAST(void*, this), total_constructions_);
+           static_cast<void*>(this), total_constructions_);
   }
 
 Foo::~Foo()
   {
     ++total_destructions_;
     printf("Foo@%p::~Foo() [#%d]\n",
-           STATIC_CAST(void*, this), total_destructions_);
+           static_cast<void*>(this), total_destructions_);
   }
 
 nsrefcnt
 Foo::AddRef()
   {
     ++refcount_;
     printf("Foo@%p::AddRef(), refcount --> %d\n",
-           STATIC_CAST(void*, this), refcount_);
+           static_cast<void*>(this), refcount_);
     return refcount_;
   }
 
 nsrefcnt
 Foo::Release()
   {
     int newcount = --refcount_;
     if ( newcount == 0 )
       printf(">>");
 
     printf("Foo@%p::Release(), refcount --> %d\n",
-           STATIC_CAST(void*, this), refcount_);
+           static_cast<void*>(this), refcount_);
 
     if ( newcount == 0 )
       {
-        printf("  delete Foo@%p\n", STATIC_CAST(void*, this));
-        printf("<<Foo@%p::Release()\n", STATIC_CAST(void*, this));
+        printf("  delete Foo@%p\n", static_cast<void*>(this));
+        printf("<<Foo@%p::Release()\n", static_cast<void*>(this));
         delete this;
       }
 
     return newcount;
   }
 
 nsresult
 Foo::QueryInterface( const nsIID& aIID, void** aResult )
 	{
-    printf("Foo@%p::QueryInterface()\n", STATIC_CAST(void*, this));
+    printf("Foo@%p::QueryInterface()\n", static_cast<void*>(this));
 		nsISupports* rawPtr = 0;
 		nsresult status = NS_OK;
 
 		if ( aIID.Equals(GetIID()) )
 			rawPtr = this;
 		else
 			{
 				nsID iid_of_ISupports = NS_ISUPPORTS_IID;
 				if ( aIID.Equals(iid_of_ISupports) )
-					rawPtr = STATIC_CAST(nsISupports*, this);
+					rawPtr = static_cast<nsISupports*>(this);
 				else
 					status = NS_ERROR_NO_INTERFACE;
 			}
 
 		NS_IF_ADDREF(rawPtr);
 		*aResult = rawPtr;
 
 		return status;
 	}
 
 nsresult
 CreateFoo( void** result )
     // a typical factory function (that calls AddRef)
   {
     printf(">>CreateFoo() --> ");
     Foo* foop = new Foo;
-    printf("Foo@%p\n", STATIC_CAST(void*, foop));
+    printf("Foo@%p\n", static_cast<void*>(foop));
 
     foop->AddRef();
     *result = foop;
 
     printf("<<CreateFoo()\n");
     return 0;
   }
 
@@ -250,40 +241,40 @@ class Bar : public Foo
 
       NS_IMETHOD QueryInterface( const nsIID&, void** );
   };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(Bar, NS_BAR_IID)
 
 Bar::Bar()
   {
-    printf("  new Bar@%p\n", STATIC_CAST(void*, this));
+    printf("  new Bar@%p\n", static_cast<void*>(this));
   }
 
 Bar::~Bar()
   {
-    printf("Bar@%p::~Bar()\n", STATIC_CAST(void*, this));
+    printf("Bar@%p::~Bar()\n", static_cast<void*>(this));
   }
 
 nsresult
 Bar::QueryInterface( const nsID& aIID, void** aResult )
 	{
-    printf("Bar@%p::QueryInterface()\n", STATIC_CAST(void*, this));
+    printf("Bar@%p::QueryInterface()\n", static_cast<void*>(this));
 		nsISupports* rawPtr = 0;
 		nsresult status = NS_OK;
 
 		if ( aIID.Equals(GetIID()) )
 			rawPtr = this;
 		else if ( aIID.Equals(NS_GET_IID(Foo)) )
-			rawPtr = STATIC_CAST(Foo*, this);
+			rawPtr = static_cast<Foo*>(this);
 		else
 			{
 				nsID iid_of_ISupports = NS_ISUPPORTS_IID;
 				if ( aIID.Equals(iid_of_ISupports) )
-					rawPtr = STATIC_CAST(nsISupports*, this);
+					rawPtr = static_cast<nsISupports*>(this);
 				else
 					status = NS_ERROR_NO_INTERFACE;
 			}
 
 		NS_IF_ADDREF(rawPtr);
 		*aResult = rawPtr;
 
 		return status;
@@ -292,17 +283,17 @@ Bar::QueryInterface( const nsID& aIID, v
 
 
 nsresult
 CreateBar( void** result )
     // a typical factory function (that calls AddRef)
   {
     printf(">>CreateBar() --> ");
     Bar* barp = new Bar;
-    printf("Bar@%p\n", STATIC_CAST(void*, barp));
+    printf("Bar@%p\n", static_cast<void*>(barp));
 
     barp->AddRef();
     *result = barp;
 
     printf("<<CreateBar()\n");
     return 0;
   }
 
@@ -320,22 +311,22 @@ void
 AnISupportsPtrPtrContext( nsISupports** )
 	{
 	}
 
 nsresult
 TestBloat_Raw_Unsafe()
 	{
 		Bar* barP = 0;
-		nsresult result = CreateBar(REINTERPRET_CAST(void**, &barP));
+		nsresult result = CreateBar(reinterpret_cast<void**>(&barP));
 
 		if ( barP )
 			{
 				Foo* fooP = 0;
-				if ( NS_SUCCEEDED( result = barP->QueryInterface(NS_GET_IID(Foo), REINTERPRET_CAST(void**, &fooP)) ) )
+				if ( NS_SUCCEEDED( result = barP->QueryInterface(NS_GET_IID(Foo), reinterpret_cast<void**>(&fooP)) ) )
 					{
 						fooP->print_totals();
 						NS_RELEASE(fooP);
 					}
 
 				NS_RELEASE(barP);
 			}
 
@@ -386,20 +377,20 @@ main()
 
         // [Shouldn't compile] Is it a compile time error to try to |Release| be hand?
       //foop->Release();
 
 				// [Shouldn't compile] Is it a compile time error to try to |delete| an |nsCOMPtr|?
 			//delete foop;
 
       printf("\n### Test  3: can you |AddRef| if you must?\n");
-      STATIC_CAST(Foo*, foop)->AddRef();
+      static_cast<Foo*>(foop)->AddRef();
 
       printf("\n### Test  4: can you |Release| if you must?\n");
-      STATIC_CAST(Foo*, foop)->Release();
+      static_cast<Foo*>(foop)->Release();
 
       printf("\n### Test  5: will a |nsCOMPtr| |Release| when it goes out of scope?\n");
     }
 
     {
       printf("\n### Test  6: will a |nsCOMPtr| call the correct destructor?\n");
       nsRefPtr<Foo> foop( do_QueryObject(new Bar) );
     }
--- a/xpcom/xpcom-config.h.in
+++ b/xpcom/xpcom-config.h.in
@@ -6,59 +6,41 @@
 /* Define this to throw() if the compiler complains about 
  * constructors returning NULL
  */
 #undef CPP_THROW_NEW
 
 /* Define if the c++ compiler supports a 2-byte wchar_t */
 #undef HAVE_CPP_2BYTE_WCHAR_T
 
-/* Define if the c++ compiler supports changing access with |using| */
-#undef HAVE_CPP_ACCESS_CHANGING_USING
-
 /* Define if the c++ compiler can resolve ambiguity with |using| */
 #undef HAVE_CPP_AMBIGUITY_RESOLVING_USING
 
 /* Define if the c++ compiler has builtin Bool type */
 #undef HAVE_CPP_BOOL
 
 /* Define if the c++ compiler supports char16_t */
 #undef HAVE_CPP_CHAR16_T
 
 /* Define if a dyanmic_cast to void* gives the most derived object */
 #undef HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
 
-/* Define if the c++ compiler supports the |explicit| keyword */
-#undef HAVE_CPP_EXPLICIT
-
 /* Define if the c++ compiler supports the modern template 
  * specialization syntax 
  */
 #undef HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
 
-/* Define if the c++ compiler supports the |std| namespace */
-#undef HAVE_CPP_NAMESPACE_STD
-
-/* Define if the c++ compiler supports reinterpret_cast */
-#undef HAVE_CPP_NEW_CASTS
-
 /* Define if the c++ compiler supports partial template specialization */
 #undef HAVE_CPP_PARTIAL_SPECIALIZATION
 
 /* Define if the c++ compiler has trouble comparing a constant
  * reference to a templatized class to zero
  */
 #undef HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
 
-/* Define if the c++ compiler supports the |typename| keyword */
-#undef HAVE_CPP_TYPENAME
-
-/* Define if the stanard template operator!=() is ambiguous */
-#undef HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
-
 /* Define if statvfs() is available */
 #undef HAVE_STATVFS
 
 /* Define if the c++ compiler requires implementations of 
  * unused virtual methods
  */
 #undef NEED_CPP_UNUSED_IMPLEMENTATIONS