[Libreoffice-commits] core.git: config_host/config_global.h.in configure.ac drawinglayer/source sc/source starmath/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Dec 7 21:48:45 UTC 2018


 config_host/config_global.h.in                    |    4 --
 configure.ac                                      |    9 ++----
 drawinglayer/source/animation/animationtiming.cxx |    9 ------
 sc/source/filter/excel/xiescher.cxx               |    9 ------
 starmath/source/parse.cxx                         |   33 ----------------------
 5 files changed, 4 insertions(+), 60 deletions(-)

New commits:
commit 6896184167ad084fad298ababff7e6d026d0b929
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Dec 7 12:32:43 2018 +0100
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Fri Dec 7 22:48:12 2018 +0100

    HAVE_CXX_CWG1579_FIX is always true now
    
    ...(according to
    <http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579> it is fixed
    in C++14), but for safety, leave the configure.ac check in for some longer.
    
    Change-Id: Ibd2f0cac228117e35ac299e2fe74207394c900cd
    Reviewed-on: https://gerrit.libreoffice.org/64773
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/config_host/config_global.h.in b/config_host/config_global.h.in
index a182c4d346c0..8c0be58faba7 100644
--- a/config_host/config_global.h.in
+++ b/config_host/config_global.h.in
@@ -27,10 +27,6 @@ Any change in this header will cause a rebuild of almost everything.
 /* Guaranteed copy elision (C++17), __cpp_guaranteed_copy_elision (C++2a): */
 #define HAVE_CPP_GUARANTEED_COPY_ELISION 0
 
-/* Fix for <http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579> "Return by converting
-   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
diff --git a/configure.ac b/configure.ac
index b7b3b03b90cb..f05c84110f4f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6499,7 +6499,8 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 CXXFLAGS=$save_CXXFLAGS
 AC_LANG_POP([C++])
 
-AC_MSG_CHECKING([whether $CXX has a fix for CWG1579])
+dnl This check can eventually be removed completely (e.g., after libreoffice-6-3 branch off):
+AC_MSG_CHECKING([that $CXX has a fix for CWG1579])
 AC_LANG_PUSH([C++])
 save_CXXFLAGS=$CXXFLAGS
 CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
@@ -6511,10 +6512,8 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
             std::unique_ptr<S2> s2(new S2);
             return s2;
         }
-    ])], [
-        AC_DEFINE([HAVE_CXX_CWG1579_FIX],[1])
-        AC_MSG_RESULT([yes])
-    ], [AC_MSG_RESULT([no])])
+    ])],
+    AC_MSG_RESULT([yes]), AC_MSG_ERROR([$CXX lacks a required fix for CWG1579]))
 CXXFLAGS=$save_CXXFLAGS
 AC_LANG_POP([C++])
 
diff --git a/drawinglayer/source/animation/animationtiming.cxx b/drawinglayer/source/animation/animationtiming.cxx
index 374def8aed6e..f3ffa88b35c8 100644
--- a/drawinglayer/source/animation/animationtiming.cxx
+++ b/drawinglayer/source/animation/animationtiming.cxx
@@ -19,7 +19,6 @@
 
 #include <memory>
 
-#include <config_global.h>
 #include <drawinglayer/animation/animationtiming.hxx>
 #include <basegfx/numeric/ftools.hxx>
 #include <o3tl/make_unique.hxx>
@@ -192,11 +191,7 @@ namespace drawinglayer
                 pNew->append(*i);
             }
 
-#if HAVE_CXX_CWG1579_FIX
             return pNew;
-#else
-            return std::move(pNew);
-#endif
         }
 
         bool AnimationEntryList::operator==(const AnimationEntry& rCandidate) const
@@ -289,11 +284,7 @@ namespace drawinglayer
                 pNew->append(*i);
             }
 
-#if HAVE_CXX_CWG1579_FIX
             return pNew;
-#else
-            return std::move(pNew);
-#endif
         }
 
         bool AnimationEntryLoop::operator==(const AnimationEntry& rCandidate) const
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 63387a275984..5d9b7b04ffc9 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -47,7 +47,6 @@
 #include <vcl/dibtools.hxx>
 #include <vcl/wmf.hxx>
 #include <comphelper/classids.hxx>
-#include <config_global.h>
 #include <toolkit/helper/vclunohelper.hxx>
 #include <basegfx/point/b2dpoint.hxx>
 #include <basegfx/polygon/b2dpolygon.hxx>
@@ -1022,11 +1021,7 @@ SdrObjectUniquePtr XclImpGroupObj::DoCreateSdrObj( XclImpDffConverter& rDffConv,
     for( ::std::vector< XclImpDrawObjRef >::const_iterator aIt = maChildren.begin(), aEnd = maChildren.end(); aIt != aEnd; ++aIt )
         rDffConv.ProcessObject( rObjList, **aIt );
     rDffConv.Progress();
-#if HAVE_CXX_CWG1579_FIX
     return xSdrObj;
-#else
-    return std::move(xSdrObj);
-#endif
 }
 
 XclImpLineObj::XclImpLineObj( const XclImpRoot& rRoot ) :
@@ -1461,11 +1456,7 @@ SdrObjectUniquePtr XclImpTextObj::DoCreateSdrObj( XclImpDffConverter& rDffConv,
     xSdrObj->SetMergedItem( makeSdrTextAutoGrowHeightItem( bAutoSize ) );
     xSdrObj->SetMergedItem( makeSdrTextWordWrapItem( true ) );
     rDffConv.Progress();
-#if HAVE_CXX_CWG1579_FIX
     return xSdrObj;
-#else
-    return std::move(xSdrObj);
-#endif
 }
 
 void XclImpTextObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& rSdrObj ) const
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index 937ef8d5b9cf..3c1fc94f7a8f 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -21,7 +21,6 @@
 #include <com/sun/star/i18n/UnicodeType.hpp>
 #include <com/sun/star/i18n/KParseTokens.hpp>
 #include <com/sun/star/i18n/KParseType.hpp>
-#include <config_global.h>
 #include <i18nlangtag/lang.h>
 #include <tools/lineend.hxx>
 #include <unotools/configmgr.hxx>
@@ -1016,11 +1015,7 @@ std::unique_ptr<SmNode> SmParser::DoAlign(bool bUseExtraSpaces)
     if (xSNode)
     {
         xSNode->SetSubNode(0, pNode.release());
-#if HAVE_CXX_CWG1579_FIX
         return xSNode;
-#else
-        return std::move(xSNode);
-#endif
     }
     return pNode;
 }
@@ -1055,11 +1050,7 @@ std::unique_ptr<SmNode> SmParser::DoLine()
 
     auto xSNode = o3tl::make_unique<SmLineNode>(m_aCurToken);
     xSNode->SetSubNodes(buildNodeArray(ExpressionArray));
-#if HAVE_CXX_CWG1579_FIX
     return xSNode;
-#else
-    return std::move(xSNode);
-#endif
 }
 
 std::unique_ptr<SmNode> SmParser::DoExpression(bool bUseExtraSpaces)
@@ -1078,11 +1069,7 @@ std::unique_ptr<SmNode> SmParser::DoExpression(bool bUseExtraSpaces)
         std::unique_ptr<SmExpressionNode> xSNode(new SmExpressionNode(m_aCurToken));
         xSNode->SetSubNodes(buildNodeArray(RelationArray));
         xSNode->SetUseExtraSpaces(bUseExtraSpaces);
-#if HAVE_CXX_CWG1579_FIX
         return xSNode;
-#else
-        return std::move(xSNode);
-#endif
     }
     else
     {
@@ -1287,11 +1274,7 @@ std::unique_ptr<SmNode> SmParser::DoSubSup(TG nActiveGroup, SmNode *pGivenNode)
     }
 
     pNode->SetSubNodes(buildNodeArray(aSubNodes));
-#if HAVE_CXX_CWG1579_FIX
     return pNode;
-#else
-    return std::move(pNode);
-#endif
 }
 
 std::unique_ptr<SmNode> SmParser::DoOpSubSup()
@@ -1307,11 +1290,7 @@ std::unique_ptr<SmNode> SmParser::DoOpSubSup()
     // get sub- supscripts if any
     if (m_aCurToken.nGroup == TG::Power)
         return DoSubSup(TG::Power, pNode.release());
-#if HAVE_CXX_CWG1579_FIX
     return pNode;
-#else
-    return std::move(pNode);
-#endif
 }
 
 std::unique_ptr<SmNode> SmParser::DoPower()
@@ -1813,11 +1792,7 @@ std::unique_ptr<SmStructureNode> SmParser::DoAttribut()
 
     xSNode->SetSubNodes(xAttr.release(), nullptr); // the body will be filled later
     xSNode->SetScaleMode(eScaleMode);
-#if HAVE_CXX_CWG1579_FIX
     return xSNode;
-#else
-    return std::move(xSNode);
-#endif
 }
 
 std::unique_ptr<SmStructureNode> SmParser::DoFontAttribut()
@@ -1838,11 +1813,7 @@ std::unique_ptr<SmStructureNode> SmParser::DoFontAttribut()
             {
                 auto pNode = o3tl::make_unique<SmFontNode>(m_aCurToken);
                 NextToken();
-#if HAVE_CXX_CWG1579_FIX
                 return pNode;
-#else
-                return std::move(pNode);
-#endif
             }
 
         case TSIZE :
@@ -2002,11 +1973,7 @@ std::unique_ptr<SmStructureNode> SmParser::DoFontSize()
     NextToken();
 
     pFontNode->SetSizeParameter(aValue, Type);
-#if HAVE_CXX_CWG1579_FIX
     return pFontNode;
-#else
-    return std::move(pFontNode);
-#endif
 }
 
 std::unique_ptr<SmStructureNode> SmParser::DoBrace()


More information about the Libreoffice-commits mailing list