build/autoconf/gcc-pr39608.m4

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/build/autoconf/gcc-pr39608.m4	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,37 @@
     1.4 +dnl This Source Code Form is subject to the terms of the Mozilla Public
     1.5 +dnl License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 +dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.7 +
     1.8 +dnl Check if the compiler is gcc and has pr39608. If so
     1.9 +dnl disable vrp.
    1.10 +
    1.11 +AC_DEFUN([MOZ_GCC_PR39608],
    1.12 +[
    1.13 +AC_MSG_CHECKING(for gcc pr39608)
    1.14 +ac_have_gcc_pr39608="yes"
    1.15 +AC_LANG_SAVE
    1.16 +AC_LANG_CPLUSPLUS
    1.17 +
    1.18 +AC_TRY_COMPILE([
    1.19 +typedef void (*FuncType)();
    1.20 +template<FuncType Impl>
    1.21 +void f();
    1.22 +template<typename T> class C {
    1.23 +  typedef C<T> ThisC;
    1.24 +  template<int g()>
    1.25 +  static void h() {
    1.26 +    f<ThisC::h<g> >();
    1.27 +  }
    1.28 +};
    1.29 +], true,
    1.30 +   ac_have_gcc_pr39608="no",
    1.31 +   true)
    1.32 +
    1.33 +AC_LANG_RESTORE
    1.34 +
    1.35 +AC_MSG_RESULT($ac_have_gcc_pr39608)
    1.36 +if test "$ac_have_gcc_pr39608" = "yes"; then
    1.37 +   echo This compiler would fail to build firefox, please upgrade.
    1.38 +   exit 1
    1.39 +fi
    1.40 +])

mercurial