build/autoconf/gcc-pr39608.m4
author David Zbarsky <dzbarsky@gmail.com>
Sun, 23 Dec 2012 03:22:22 -0500
changeset 126045 9f3051733fec0917d7d4bc30e4a8e7aaca4d7362
parent 113218 c3590f5e7e1fead463d93538ddb7b2e82426a371
child 151567 6c6b968a895a5a3e74f438c44803503b239dd4e1
permissions -rw-r--r--
Bug 823394 Part 1:Merge nsSVGStylableElement/nsSVGElement and nsIDOMSVGStylable/nsIDOMSVGElement r=bz

dnl This Source Code Form is subject to the terms of the Mozilla Public
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.

dnl Check if the compiler is gcc and has pr39608. If so
dnl disable vrp.

AC_DEFUN([MOZ_GCC_PR39608],
[
AC_MSG_CHECKING(for gcc pr39608)
ac_have_gcc_pr39608="yes"
AC_LANG_SAVE
AC_LANG_CPLUSPLUS

AC_TRY_COMPILE([
typedef void (*FuncType)();
template<FuncType Impl>
void f();
template<typename T> class C {
  typedef C<T> ThisC;
  template<int g()>
  static void h() {
    f<ThisC::h<g> >();
  }
};
], true,
   ac_have_gcc_pr39608="no",
   true)

AC_LANG_RESTORE

AC_MSG_RESULT($ac_have_gcc_pr39608)
if test "$ac_have_gcc_pr39608" = "yes"; then
   echo This compiler would fail to build firefox, plase upgrade.
   exit 1
fi
])