summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)AuthorFilesLines
2019-10-29loplugin:finalclasses fix checkNoel Grandin1-2/+2
need to check after we generate the inherited-from set, not before Change-Id: Ic66deeb680f4a2505d66f99872ac7a5bc263cda9 Reviewed-on: https://gerrit.libreoffice.org/81636 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-28loplugin:finalclasses look for classes with virtual membersNoel Grandin1-6/+14
where making them final gives the compiler freedom to de-virtualise some calls Change-Id: I5755a41c42d9f23af58b873efae37a1d240fbd89 Reviewed-on: https://gerrit.libreoffice.org/81618 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-28Completely remove lambda capture that is unusedStephan Bergmann1-2/+1
...since 6d6fad522a2cd6a2959ea774969a86288f5a3cb7 "Introduce OStringChar" (and had needlessly been kept alive with ce3badb157c58941608f878a7de98c7739e30aec "compilerplugins: fix -Werror,-Wunused-lambda-capture") Change-Id: Ie34ef1197f97ecab5b8f30741f1e2c4b3a9db594 Reviewed-on: https://gerrit.libreoffice.org/81591 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-28loplugin:stringadd improve detectionNoel Grandin2-27/+48
if one side of the expression is a compile-time-constant, we don't need to worry about side-effects on the other side Change-Id: Iee71ea51b327ef244bf39f128f921ac325d74e2b Reviewed-on: https://gerrit.libreoffice.org/81589 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-25compilerplugins: fix -Werror,-Wunused-lambda-captureMiklos Vajna1-0/+1
Change-Id: I2a1374a1e79401c2107d003102ab797fac9a3d66
2019-10-24Introduce OStringCharStephan Bergmann2-10/+1
...similar to OUStringChar, to be used in string concatenation expressions. And enable the corresponding loplugin:stringadd check, and fix its findings. Change-Id: I35ebb2253ba82bda6c98ae6ebd2ad4f27cf9abf9 Reviewed-on: https://gerrit.libreoffice.org/81456 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-24This is fixed now on Clang trunkStephan Bergmann2-3/+16
...since <https://github.com/llvm/llvm-project/commit/ dc3957ec215dd17b8d293461f18696566637a6cd> "Include leading attributes in DeclStmt's SourceRange" Change-Id: I21859dfdcb454a9dd4444ce299548bf75043b1ab Reviewed-on: https://gerrit.libreoffice.org/81424 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-23Don't use broken StringAdd::getSourceAsStringStephan Bergmann1-16/+2
it caused clang-cl to crash when processing desktop/source/app/opencl.cxx Change-Id: I0a39697e75242cd00f12b60477d51a1e5bf96a4f Reviewed-on: https://gerrit.libreoffice.org/81409 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-23Fix call to NamedDecl::getNameStephan Bergmann1-4/+7
...which fails at least with clang-8.0.0-3.fc30.x86_64 with "clang-8: /usr/include/clang/AST/Decl.h:277: llvm::StringRef clang::NamedDecl::getName() const: Assertion `Name.isIdentifier() && "Name is not a simple identifier"' failed." Change-Id: I6999240e2b518b6818a43d1e5ac92224300b343f Reviewed-on: https://gerrit.libreoffice.org/81415 Tested-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-23loplugin:unusedfieldsNoel Grandin4-38/+50
Change-Id: I1f69ec45e7d44e45a6ece1fe9d9eef8a2be2d6ff Reviewed-on: https://gerrit.libreoffice.org/81361 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-23loplugin:unusedmethodsNoel Grandin1-67/+53
Change-Id: I5fd081780d46fd30864830eea2956bad6dc3e222 Reviewed-on: https://gerrit.libreoffice.org/81360 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-22loplugin:unusedenumconstantsNoel Grandin3-3520/+3488
Change-Id: I76aadeefce66df93f21b7e45c0e87ab92df45131 Reviewed-on: https://gerrit.libreoffice.org/81324 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-22Avoid C++20 operator overloading ambiguityStephan Bergmann2-10/+35
...which is reported now by Clang 10 trunk with -std=c++2a: > cui/source/tabpages/tpline.cxx:481:80: error: use of overloaded operator '==' is ambiguous (with operand types 'const XLineEndItem' and 'XLineStartItem') > if( pItem && ( !pOld || !( *static_cast<const XLineEndItem*>(pOld) == *pItem ) ) ) > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~ > include/svx/xlnstit.hxx:43:29: note: candidate function (with reversed parameter order) > virtual bool operator==(const SfxPoolItem& rItem) const override; > ^ > include/svx/xlnedit.hxx:43:29: note: candidate function > virtual bool operator==(const SfxPoolItem& rItem) const override; > ^ But the base SfxPoolItem::operator == is virtual anyway, so no need to cast pOld to a derived type. And once the expression is changed to !( *pOld == *pItem ) loplugin:simplifybool would kick in, but only with old compilers. So update loplugin:simplifybool to also kick in on that with latest Clang trunk with -std=c++2a, and simplify the expression accordingly. Change-Id: I3de9175b30d8645ed7a52f87cfac320144576cc8 Reviewed-on: https://gerrit.libreoffice.org/81203 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-22loplugin:constantparamNoel Grandin4-847/+840
Change-Id: Ibfe70492683ff3ec208cee95d8a11155ec54f690 Reviewed-on: https://gerrit.libreoffice.org/81314 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-22loplugin:singlevalfieldsNoel Grandin2-190/+124
Change-Id: I92c5634b16862abe1c73c20cfe66abe92f58bb88 Reviewed-on: https://gerrit.libreoffice.org/81303 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-22loplugin:virtualdead unused param in ResourceChangeListenerNoel Grandin1-3/+0
Change-Id: I6bfaef6694ec654889ddf1f300851f323bcc56b3 Reviewed-on: https://gerrit.libreoffice.org/81272 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-22loplugin:virtualdead unused param in ChartTypeDialogControllerNoel Grandin1-3/+0
Change-Id: I71eaedcd2fbd5b6d05bc90c4c5ddbc7fca9f5925 Reviewed-on: https://gerrit.libreoffice.org/81271 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-22loplugin:virtualdead unused params in OCacheSetNoel Grandin1-9/+0
these methods do nothing except forward to their similar named variants, so just remove them Change-Id: I28d31bbe2c1e39fe5a9c2d7eaa9e14006213ab27 Reviewed-on: https://gerrit.libreoffice.org/81247 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-22loplugin:virtualdead unused param in IContainerApproveNoel Grandin1-3/+0
Change-Id: I59edede149d02085125ee946994b6088c3152e7b Reviewed-on: https://gerrit.libreoffice.org/81246 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-22There doesn't need to be a TemplateSpecializationType hereStephan Bergmann1-1/+0
On both macOS (libc++) and Windows (MSVC standard library), compilerplugins/clang/test/getstr.cxx failed four tests without this fix: > error: 'error' diagnostics expected but not seen: > File compilerplugins/clang/test/getstr.cxx Line 29: suspicious use of 'getStr' on an object of type 'rtl::OUStringBuffer'; the result is implicitly cast to a void pointer in a call of 'operator <<' [loplugin:getstr] > File compilerplugins/clang/test/getstr.cxx Line 30: directly use object of type 'S' (aka 'rtl::OString') in a call of 'operator <<', instead of calling 'getStr' first [loplugin:getstr] > File compilerplugins/clang/test/getstr.cxx Line 34: suspicious use of 'getStr' on an object of type 'rtl::OUStringBuffer'; the result is implicitly cast to a void pointer in a call of 'operator <<' [loplugin:getstr] > File compilerplugins/clang/test/getstr.cxx Line 35: directly use object of type 'rtl::OString' in a call of 'operator <<', instead of calling 'getStr' first [loplugin:getstr] Change-Id: I65406d3d84bb5a89df44c8fd665b6e38d19f38c7 Reviewed-on: https://gerrit.libreoffice.org/81266 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-21Make loplugin:stringcostant find some misuses of OUStringBuffer::appendStephan Bergmann2-8/+34
...like the one manually found at 06845c14a17146b0ec50dd3704b6af9ee13927bc "This should have become a UTF-16 string literal". (No further misuses were found across the code base.) Change-Id: I0b604bdaaa38bd9248440ff7bd7bf0545fc6426a Reviewed-on: https://gerrit.libreoffice.org/81250 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-21loplugin:virtualdead unused param in IControlActionListenerNoel Grandin1-3/+0
Change-Id: I2ce8df6a9a1ac2e6d6c5de08b32fb671bf10cd17 Reviewed-on: https://gerrit.libreoffice.org/81244 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in OTableRowViewNoel Grandin1-6/+0
Change-Id: Ice8d68284800e12af3e334722cc6109a1614e335 Reviewed-on: https://gerrit.libreoffice.org/81243 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused params in formsNoel Grandin1-6/+0
Change-Id: Iac26ba57443060474f4f33c4f449a69eca8c1063 Reviewed-on: https://gerrit.libreoffice.org/81236 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in SvtFileDialog_BaseNoel Grandin1-3/+0
Change-Id: Id10c6df2a9d00f19dc1dc314515fedbe90918f66 Reviewed-on: https://gerrit.libreoffice.org/81235 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in EditEngine::FieldClickedNoel Grandin1-3/+0
Change-Id: Iffe075960308d5058cb7535e9216caa37aabe0c5 Reviewed-on: https://gerrit.libreoffice.org/81232 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in UnknownAttrTokenNoel Grandin1-3/+0
Change-Id: Iccf88b919cfc40419271e6f18d101027ef2bb9df Reviewed-on: https://gerrit.libreoffice.org/81218 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in ProcessClientAnchor2Noel Grandin1-3/+0
Change-Id: Ic766fcc1bfd33d891edc1da87e1b35a8efba169a Reviewed-on: https://gerrit.libreoffice.org/81217 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in SfxObjectShell::FillClassNoel Grandin1-3/+0
and since I notice that the two call sites also don't care about pShortTypeName, remove that too Change-Id: I4649fc4c134c1113555b9dedb53499ce39d17132 Reviewed-on: https://gerrit.libreoffice.org/81213 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in SfxStatusListener::StateChangedNoel Grandin1-3/+0
Change-Id: Ic467490ddd1b0762bfa61878c4026afb53b02743 Reviewed-on: https://gerrit.libreoffice.org/81212 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21Don't invoke the linker when generating pch filesStephan Bergmann1-2/+2
When `llvm-config --cxxflags` outputs -Wl,... options (as has been discussed at 824d9394b529bb1fc521e4a4df8c4e3458ec5641 "Properly handle comma in CLANGFLAGS", and which end up on the compiler command lines here), Clang failed with an error "cannot specify -o when generating multiple output files" when generating sharedvisitor/clang.pch. Change-Id: I200ebd152f5a524ce7ecdd2f25c34bbaa634f515 Reviewed-on: https://gerrit.libreoffice.org/81065 Tested-by: Jenkins Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-21loplugin:deadvirtual unused param in ItemUpdateReceiverInterfaceNoel Grandin1-3/+0
Change-Id: I3db5a456a259a97dc9bdf6be0d478177bac05215 Reviewed-on: https://gerrit.libreoffice.org/81186 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in TitleBar::PaintDecorationNoel Grandin1-3/+0
Change-Id: I3dd8ee6492be1a4b3d1032c4d50cc01111d748cb Reviewed-on: https://gerrit.libreoffice.org/81185 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in ITableRendererNoel Grandin1-9/+0
Change-Id: I008ff69494af305485a022def72a14a04b26a19e Reviewed-on: https://gerrit.libreoffice.org/81183 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in ThumbnailViewItem::calculateItemsPositionNoel Grandin1-3/+0
Change-Id: I8db99a3672e3603a25ee1f6ca4741a02b73c9516 Reviewed-on: https://gerrit.libreoffice.org/81184 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in FmXDisposeListener::disposingNoel Grandin1-3/+0
Change-Id: I2189f0a35b03bc8192ab91cd63b210f303f5d3e6 Reviewed-on: https://gerrit.libreoffice.org/81182 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in SdrHdl::onHelpRequestNoel Grandin1-3/+0
Change-Id: I3d75755bd6fd7f3168725c53fd8ce571a938fa37 Reviewed-on: https://gerrit.libreoffice.org/81181 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in GetSdrRepeatCommentNoel Grandin1-3/+0
Change-Id: I0a27d1a200e8af50adf98de2c5ba7d3c7e199b00 Reviewed-on: https://gerrit.libreoffice.org/81180 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-21loplugin:virtualdead unused param in CreateSvxFormatCellsDialogNoel Grandin1-3/+0
Change-Id: I8455c10d62ae8c3c3e6e543301f8c69a1189456a Reviewed-on: https://gerrit.libreoffice.org/81179 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-20loplugin:virtualdead unused param in Task::UpdateMinPeriodNoel Grandin1-3/+0
Change-Id: Ie24f56fed811b3b317d6c20e15289e7cecfb738d Reviewed-on: https://gerrit.libreoffice.org/81157 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-20loplugin:virtualdead unused param in SvListView::ModelIsMovingNoel Grandin1-3/+0
Change-Id: I83af14bb3a29cb8a4a36f714ac2fb91687f13996 Reviewed-on: https://gerrit.libreoffice.org/81156 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-20loplugin:virtualdead unused param in RedlineAdjustStartNodeCursorNoel Grandin1-3/+0
Change-Id: Ic8eaad705b0cf8289035f7eee3ad01439fc24ee7 Reviewed-on: https://gerrit.libreoffice.org/81155 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-20loplugin:virtualdead unused param in XMLEventContextFactory::CreateContextNoel Grandin1-3/+0
Change-Id: I6fda2e04724d69fd218ffc85f9881b429714e63b Reviewed-on: https://gerrit.libreoffice.org/81154 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-19loplugin:unusedfieldsNoel Grandin4-76/+78
Change-Id: I7dd5fc3d53df63fd2ee2caa71586f0f5e13f187e Reviewed-on: https://gerrit.libreoffice.org/81078 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-19loplugin:unusedmethodsNoel Grandin2-113/+141
Change-Id: I95e63105654952d12c1dfd62f51593de114be569 Reviewed-on: https://gerrit.libreoffice.org/81077 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-19loplugin:virtualdead unused param in ValueGetter::processValueNoel Grandin1-3/+0
Change-Id: Id2b514b0892f8d7cf93fe3c5884e8d89a6f0a7b1 Reviewed-on: https://gerrit.libreoffice.org/81076 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-19loplugin:virtualdead unused param in sd::View::AcceptDropNoel Grandin1-3/+0
Change-Id: I51aceb8a1f908cf89a0b8b6d0e58755fc4374862 Reviewed-on: https://gerrit.libreoffice.org/81075 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-19loplugin:virtualdead unused param in ViewClipboard::DetermineInsertPositionNoel Grandin1-3/+0
Change-Id: Iad1a4dbd603e9258e8835e7ab534cd74f4882968 Reviewed-on: https://gerrit.libreoffice.org/81074 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-19loplugin:virtualdead unused param in sd::ViewShell::UpdatePreviewNoel Grandin1-3/+0
Change-Id: I1ac98096d117e3ae7c2f0be2690acef32b85fbdb Reviewed-on: https://gerrit.libreoffice.org/81073 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-19loplugin:virtualdead unused params in OGLTransitionImplNoel Grandin1-6/+0
rename finish to cleanup to avoid conflict with already existing finish method Change-Id: I1036eea7e50b20c3c17d769c4094c640939d552d Reviewed-on: https://gerrit.libreoffice.org/81072 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>