summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-08-31 16:13:18 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-08-31 20:14:40 +0200
commitd9998186d37c58751f45dd7cb97d6c72f901a346 (patch)
tree01e31bd159062beaecc62edfc01b77220f87d7a1 /configure.ac
parentb5f081e1ac14f60497f62a27be86b07b0baa42f7 (diff)
GCC only supports inline variables since GCC 7
(see also discussion at <https://gerrit.libreoffice.org/#/c/59204/11> "new loplugin:conststringfield" about its changes to registry/source/regimpl.cxx) Change-Id: Id2743adbfeb4d7c42105a65ba8400d7051da2f03 Reviewed-on: https://gerrit.libreoffice.org/59873 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 4c968365faaf..3c9e5dc5e908 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6429,6 +6429,25 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++])
+AC_MSG_CHECKING([whether $CXX supports inline variables])
+AC_LANG_PUSH([C++])
+save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ #if !defined __cpp_inline_variables
+ // This tests for one specific aspect of inline variables that is actually used by by
+ // ORegistry::ROOT (registry/source/regimpl.cxx):
+ struct S { constexpr S() {} };
+ struct T { static constexpr S s{}; };
+ S const * f() { return &T::s; }
+ #endif
+ ]])], [
+ AC_DEFINE([HAVE_CPP_INLINE_VARIABLES],[1])
+ AC_MSG_RESULT([yes])
+ ], [AC_MSG_RESULT([no])])
+CXXFLAGS=$save_CXXFLAGS
+AC_LANG_POP([C++])
+
AC_MSG_CHECKING([whether $CXX has a fix for CWG1579])
AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS