summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-09-30 15:56:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-09-30 15:56:26 +0200
commit6cc54913077864ba92d2fdc3addec29ea89770fe (patch)
tree6c0b82edb368d65b3fb2e76f00b2e95e0fb24f7f /configure.ac
parenta18fc918d5348886bc64c30227583a0e73856cf3 (diff)
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
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac22
1 files changed, 13 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 73855b01602e..5a808873ffe2 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