Bug 235381 2004-02-23-12-trunk Solaris nightly crashes at nsComponentManagerImpl::GetLoaderForType()

r=roland.mainz, sr=dbaron
add -features=tmplife to Sun Forte compiler, introduced a test for the C++ compiler generating correct temporary object destruct order.
patch by anlan@ida.liu.se
This commit is contained in:
kyle.yuan%sun.com 2004-05-24 02:56:09 +00:00
parent 6d30739384
commit 8313bb7bef

View File

@ -1525,7 +1525,7 @@ dnl the qsort routine under solaris is faulty
NS_USE_NATIVE=1
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
CFLAGS="$CFLAGS -xstrconst -xbuiltin=%all"
CXXFLAGS="$CXXFLAGS -xbuiltin=%all"
CXXFLAGS="$CXXFLAGS -xbuiltin=%all -features=tmplife"
LDFLAGS="-xildoff -zlazyload -zcombreloc $LDFLAGS"
MOZ_OPTIMIZE_FLAGS="-xO4"
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -o $@'
@ -4822,6 +4822,36 @@ if test "$_PEDANTIC"; then
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