summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-08-28 17:07:16 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-08-30 17:14:54 +0200
commitc00948d9bd35dfb15a331c2163f32e9ee24644fd (patch)
treecdbfb9eda843f0b9e970f3fcf913bd406ad0ca3f
parent412c1a3089904a95e18b3ac34eb432e4b87c8fbb (diff)
Silence bogus -Werror=redundant-move (GCC 9)
Change-Id: Ia078fb8e1e497edfa08e2a61d1659100461fc52e Reviewed-on: https://gerrit.libreoffice.org/59720 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--config_host/config_global.h.in4
-rw-r--r--configure.ac15
-rw-r--r--editeng/source/editeng/editeng.cxx5
3 files changed, 24 insertions, 0 deletions
diff --git a/config_host/config_global.h.in b/config_host/config_global.h.in
index 375e610a1180..2a681264992b 100644
--- a/config_host/config_global.h.in
+++ b/config_host/config_global.h.in
@@ -30,4 +30,8 @@ Any change in this header will cause a rebuild of almost everything.
move constructor": */
#define HAVE_CXX_CWG1579_FIX 0
+/* GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87150> "move ctor wrongly chosen in return
+ stmt (derived vs. base)": */
+#define HAVE_GCC_BUG_87150 0
+
#endif
diff --git a/configure.ac b/configure.ac
index 8a0de7e22435..f4f7303c0146 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6445,6 +6445,21 @@ CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++])
AC_SUBST([HAVE_CXX_CWG1579_FIX])
+AC_MSG_CHECKING([whether $CXX has GCC bug 87150])
+AC_LANG_PUSH([C++])
+save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+ struct S1 { S1(S1 &&); };
+ struct S2: S1 {};
+ S1 f(S2 s) { return s; }
+ ])], [
+ AC_DEFINE([HAVE_GCC_BUG_87150],[1])
+ AC_MSG_RESULT([yes])
+ ], [AC_MSG_RESULT([no])])
+CXXFLAGS=$save_CXXFLAGS
+AC_LANG_POP([C++])
+
dnl ===================================================================
dnl system stl sanity tests
dnl ===================================================================
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index e2c4a63f3efd..e601fa4172e7 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -21,6 +21,7 @@
#include <utility>
#include <comphelper/lok.hxx>
+#include <config_global.h>
#include <vcl/wrkwin.hxx>
#include <vcl/dialog.hxx>
#include <vcl/weld.hxx>
@@ -2650,7 +2651,11 @@ vcl::Font EditEngine::CreateFontFromItemSet( const SfxItemSet& rItemSet, SvtScri
{
SvxFont aFont;
CreateFont( aFont, rItemSet, true, nScriptType );
+#if HAVE_GCC_BUG_87150
+ return aFont;
+#else
return std::move(aFont);
+#endif
}
SvxFont EditEngine::CreateSvxFontFromItemSet( const SfxItemSet& rItemSet )