summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/sequenceloop.cxx
AgeCommit message (Collapse)Author
2020-02-23Revert "loplugin:sequenceloop improve rvalue detection"Noel Grandin
This reverts commit 3aca35f1505fa552eaa316a2d47a60ef52646525. Reason for revert: see commentary at https://gerrit.libreoffice.org/c/core/+/89184 I misunderstood - even though this is a local copy, we will still call non-const begin()/end() and cause further allocations internal to the Sequence Change-Id: Ia9ecacc6312afc2c9c80ca72afe6182d9b70241b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89137 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-02-21loplugin:sequenceloop improve rvalue detectionNoel Grandin
to avoid false positives Change-Id: Id20eb0837fa6764139af3fc4481c768700ec2dad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89184 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-09-25Improve loplugin:sequenceloop diagnostic adviceStephan Bergmann
"make range var const" sounded to me like it talked about the variable declared in the for-range-declaration, not a variable referenced in the for-range- initializer Change-Id: Ie777e1374ead7f37c8efb022cd87e980d2ee9810 Reviewed-on: https://gerrit.libreoffice.org/79563 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-26use shared-plugin infra for some recent pluginsNoel Grandin
Change-Id: Ia9cba59718de91fed2045ffd7e0ec06d28bf37dc Reviewed-on: https://gerrit.libreoffice.org/78118 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-23Improve loplugin:sequenceloop warningStephan Bergmann
...from > sfx2/source/appl/shutdowniconaqua.mm:416:13: error: use std::as_const, or make range var const, to avoid creating a copy of the Sequence [loplugin:sequenceloop] > for ( auto const & newMenuProp : aNewMenu ) > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ to > sfx2/source/appl/shutdowniconaqua.mm:416:46: error: use std::as_const, or make range var const, to avoid creating a copy of the Sequence [loplugin:sequenceloop] > for ( auto const & newMenuProp : aNewMenu ) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~ Change-Id: I1eabe80abeed1784a246a6e3c9b7036f664ee681 Reviewed-on: https://gerrit.libreoffice.org/77989 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-16new loplugin:sequenceloopNoel Grandin
look for places we should be using std::as_const on for-range loops over uno::Sequence, to avoid triggering a copy Change-Id: I7efb641bf09d37c87946f03428ee4eec90298c8a Reviewed-on: https://gerrit.libreoffice.org/77441 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>