[Libreoffice-commits] core.git: configure.ac

Stephan Bergmann sbergman at redhat.com
Wed Sep 30 06:58:42 PDT 2015


 configure.ac |   22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

New commits:
commit 6cc54913077864ba92d2fdc3addec29ea89770fe
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Sep 30 15:56:26 2015 +0200

    Work around GCC 5.1 ICE
    
      in constexpr expansion of ‘operator|<ImplFontAttrs>((ImplFontAttrs)33554432u,
       (ImplFontAttrs)16777216u ...
    
    in unotools/source/config/fontcfg.cxx, at least with "g++ (GCC) 5.1.1 20150618
    (Red Hat 5.1.1-4)"
    
    Change-Id: I715e92d524ceaffdd2f0e73a39d1c816ee8f1644

diff --git a/configure.ac b/configure.ac
index 73855b0..5a80887 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6329,17 +6329,21 @@ fi
 AC_MSG_CHECKING([whether $CXX supports C++14 constexpr])
 save_CXXFLAGS=$CXXFLAGS
 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
+if test "$ENABLE_DEBUG" != TRUE -a "$ENABLE_DBGUTIL" != TRUE \
+    -a "$ASSERT_ALWAYS_ABORT" != TRUE
+then
+    CXXFLAGS="$CXXFLAGS -DNDEBUG"
+fi
 AC_LANG_PUSH([C++])
 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-    struct S {
-        int n_;
-        constexpr bool f() {
-            int n = n_;
-            int i = 0;
-            while (n > 0) { --n; ++i; }
-            return i == 0;
-        }
-    };
+    #include <cassert>
+    template<typename T> inline constexpr T f(T x) { return x; }
+    template<typename T> inline constexpr T g(T x) {
+        assert(f(static_cast<int>(x)));
+        return x;
+    }
+    enum E { e };
+    auto v = g(E::e);
     ]])], [cxx14_constexpr=yes], [cxx14_constexpr=no])
 AC_LANG_POP([C++])
 CXXFLAGS=$save_CXXFLAGS


More information about the Libreoffice-commits mailing list