diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-07 18:41:58 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-09 13:33:51 +0200 |
commit | fcc31cd0e0a6544a13dac0fdc66005d77f6f5cf9 (patch) | |
tree | fd6a03bb97bbac51afb87df5c24911b7c6e462a8 /unotools | |
parent | 161a710592af30121fdf0bb4015fe66442607d92 (diff) |
Revert "clang-tidy performance-move-const-arg"
This reverts commit 3d604d1cd6cc70ef96782ef769f0479b509987a8.
comments from sberg:
I assume dropping the std::move from aCurSel(std::move(aSel)) is caused
by performance-move-const-arg's warning "if std::move() is called with
an argument of a trivially-copyable type"
(<https://clang.llvm.org/extra/clang-tidy/checks/performance-move-const-arg.html>).
For my taste, that approach is too tightly tied to a class's current
implementation details, something that may change over time. Imagine a
trivially copyable class C with a raw pointer member (where the
lifecycle of the pointed-to object is tracked by some higher-level,
likely broken protocol). Now, that protocol is fixed and the raw
pointer member is replaced with a std::shared_ptr. C is no longer
trivially copyable, and the dropped std::move would turn out to be
beneficial again.
(Also, if Clang and clang-tidy did implement the fixed rules for
trivially copyable classes from CWG1734/C++17, where a subset of a
trivially copyable class's copy/move members may be deleted, the above
rule to warn "if std::move() is called with an argument of a
trivially-copyable type" would no longer make sense as written; consider
a trivially copyable class whose copy ctor has been deleted.)
Change-Id: Icb91610e50ed98b8f55fe6323bdfa48c8cb9b4b9
Reviewed-on: https://gerrit.libreoffice.org/60166
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/confignode.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx index fa94fc51a508..66d44cdc8301 100644 --- a/unotools/source/config/confignode.cxx +++ b/unotools/source/config/confignode.cxx @@ -97,7 +97,7 @@ namespace utl , m_xDirectAccess(std::move(_rSource.m_xDirectAccess)) , m_xReplaceAccess(std::move(_rSource.m_xReplaceAccess)) , m_xContainerAccess(std::move(_rSource.m_xContainerAccess)) - , m_bEscapeNames(_rSource.m_bEscapeNames) + , m_bEscapeNames(std::move(_rSource.m_bEscapeNames)) { Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY); if (xConfigNodeComp.is()) @@ -129,7 +129,7 @@ namespace utl m_xDirectAccess = std::move(_rSource.m_xDirectAccess); m_xContainerAccess = std::move(_rSource.m_xContainerAccess); m_xReplaceAccess = std::move(_rSource.m_xReplaceAccess); - m_bEscapeNames = _rSource.m_bEscapeNames; + m_bEscapeNames = std::move(_rSource.m_bEscapeNames); Reference< XComponent > xConfigNodeComp(m_xDirectAccess, UNO_QUERY); if (xConfigNodeComp.is()) |