summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)Author
2017-01-26Make test work with older ClangStephan Bergmann
For some reason, e.g. Clang 3.8.1 doesn't evaluate std::strlen here (though it apparently does in other places in this file). Change-Id: Ib2b7dcc1d7b6ae47ef285bd2edb65e399dc11b79 Reviewed-on: https://gerrit.libreoffice.org/33547 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-01-25Bypass some lines that cause problems with Clang 3.8.1 at leastTor Lillqvist
Change-Id: I05202ee6b2f083e8aacf0a2a8f8d7b8b361a5df8
2017-01-25Minor loplugin:stringconstant improvementsStephan Bergmann
Change-Id: I0b39526c0f0854ddbb29e77ece303cf2bdd842c4
2017-01-24Use proper check for FunctionProtoTypeStephan Bergmann
...as at least MSVC SAL_CALL-annotated functions have an AttributeType wrapped around the FunctionProtoType. Change-Id: Ic085e2e3649e6b2fc8ca380047133a8edbe20589
2017-01-24teach unusedvariablecheck plugin about SfxPoolItem subclassesNoel Grandin
which can all be treated as SAL_WARN_UNUSED The eehtml.cxx change probably fixes some CJK/CTL bug somewhere Change-Id: I6852129540f316075aee907971ac19418d71dd9a
2017-01-23new loplugin useuniqueptrNoel Grandin
Change-Id: Ic7a8b32887c968d86568e4cfad7ddd1f4da7c73f Reviewed-on: https://gerrit.libreoffice.org/33339 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-19New loplugin:dynexcspec: Add @throws documentationStephan Bergmann
See the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2017-January/076665.html> "Dynamic Exception Specifications" for details. * The check for missing @throws documentation is not too specific, it just checks whether a function with dynamic exception specification has /any/ @throws clause, not necessarily exactly matching the exception types. (Many of the details in the existing dynamic exception specifications are probably not very useful, anyway.) * When adding @throws clauses, I bluntly copied the exception specifications except for dropping any mentions of std::exception (except in the rare cases where that was the only exception typed mentioned). * In many places it might have looked more natural to use trailing Doxygen comments of the ///< @throws ... kind, but Clang's getCommentForDecl unfortunately doesn't detect trailing comments on function decls. * Also, Clang's getCommentForDecl doesn't look into macros, so some trivial silly macros were expanded along the way to add comments where necessary. Change-Id: I1831d72df2d9c801d4b8dd7d708d9cefea039589
2017-01-16Use compat::isLookupContextStephan Bergmann
Change-Id: I5b4523929f971d0345f112ba4f5faff1181cee2b
2017-01-13inline InitGuardNoel Grandin
since it is only used in one place Change-Id: Ie541a255ddbe71105f6b58f02f372f4f45667d7a
2017-01-12Adapt loplugin:overrideparam to recent Clang trunk changeStephan Bergmann
Change-Id: Ia372e39bc7e51f290a6d631bf0b81fd75f4fdc1d
2017-01-11Remove leftover codeStephan Bergmann
Change-Id: I3f6e9ec0343074b506cb07b1ad5c9b3e1ef20b5e
2017-01-11loplugin:stringconstant: handle OStringBuffer::appendStephan Bergmann
Change-Id: I283da52c0ee2b63c19e31e9a61ab24997c037a6a
2017-01-11loplugin:externvar (clang-cl)Stephan Bergmann
Change-Id: I81877e46cf95dcc7de16b797fca33658036bf9e8
2017-01-11loplugin:externvar (clang-cl)Stephan Bergmann
Change-Id: I638199f1455bead71f0a03f15e4b6f418a0cd0e2
2017-01-11Some loplugin:conststringvar/stringconstant improvementsStephan Bergmann
Change-Id: I73f694e6dedb84b3fb3b63ffb9dcda2481bc403c
2017-01-10Work around problems with isCXX11ConstantExpr in template codeStephan Bergmann
> template<size_t Size> > bool checkOutput(ScDocument* pDoc, const ScRange& aOutRange, const char* aOutputCheck[][Size], const char* pCaption) > { > ... > const char* p = aOutputCheck[nRow][nCol]; in sc/qa/unit/helper/qahelper.hxx caused > assert(E->isRValue() && E->getType()->hasPointerRepresentation()); in Clang's EvaluatePointer (lib/AST/ExprConstant.cpp) to fire. In the template definition itself, Clang doesn't introduce ArrayToPointerDecay ImplicitCastExpr into the subscripting operations (while in any implicit specializations that it instantiates, it does). This is interesting: Up to C++11, [expr.sub] requires the operator to have pointer type (so array-to-pointer decay is clearly asked for). In C++14 (CWG1213), the operator can also be of array type but it is not explicitly specified whether array-to-pointer decay is to be performed. In upcoming C++17 (P0135R1), it specifies further that an operator of array type must be a glvalue but still does not explicitly specify whether array-to-pointer decay is to be performed. Maybe the definition of the subscripting operation in terms of *((E1)+(E2)) is meant to imply that, however. Change-Id: I67c7b0f34002387dbf746288630371877c6261ef
2017-01-10New loplugin:conststringvarStephan Bergmann
Change-Id: I16648b018ed0f69a085322cfb88481ee2a0c27ca
2017-01-09New loplugin:externvarStephan Bergmann
Change-Id: Ie5404f11cbc5b05bd18455ae81526eb2de01548c
2017-01-06New loplugin:charrightshiftStephan Bergmann
Change-Id: Ib645fb11004bc0fe05c9c416ae72b0ae56c23a15
2017-01-05Don't exclude a var from loplugin:salbool merely because of use in >>=Stephan Bergmann
Change-Id: I1b8a3dfa1dc6b351ab0903a74eae19dfa6d0888d
2016-12-23merge IScript with NewStyleUNOScriptNoel Grandin
Change-Id: Iae70d0780678eb8df8a9e57fce5fc2f6c5ed427e Reviewed-on: https://gerrit.libreoffice.org/32375 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-23merge svx::sidebar::BulletsSettings with svx::sidebar::BulletsSettings_ImplNoel Grandin
Change-Id: I7cf6bb4cf3aa532718753904c2100882b0df6775 Reviewed-on: https://gerrit.libreoffice.org/32373 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-23merge StringNode with RscDefineNoel Grandin
Change-Id: Ia64b7419ccbb06ff55907717963864caef2023a8 Reviewed-on: https://gerrit.libreoffice.org/32374 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-23update results from mergeclasses pluginNoel Grandin
Change-Id: Ie92ebbae246007609fa4b65e8b9cf1ca16e62cc5
2016-12-22Generalize vector/deque ctor checks to work with MSVCRTStephan Bergmann
Change-Id: I2d493a36b8c2e3abe69964c04b46f08d67ef8a48
2016-12-22Some more bool-like types for Windows/clang-clStephan Bergmann
"TW_BOOL" seen e.g. in extensions/source/scanner/scanwin.cxx "boolean" seen e.g. in extensions/source/activex/SOActionsApproval.h Change-Id: I78281cd4f92c3e0c0d885cc2466665a06f5bcd85
2016-12-22That whitelisted code is already gone againStephan Bergmann
Change-Id: I1fa04b51823ac9707f0dd3d7c8209c69e917ef28
2016-12-22Also don't warn for plain C codeStephan Bergmann
...as needed by clang-cl for bean/native/win32/com_sun_star_comp_beans_LocalOfficeWindow.c Change-Id: I862afb6b549015d951a898ee415370540ffab1f6
2016-12-19vcl: separate ImplImageTree - ImageTree singleton and public ifaceTomaž Vajngerl
ImplImageTree was used outside of VCL which is not consistent with the name and the header also contains a lot of implementation detail. This separates the implementation to ImplImageTree and the public interface and singleton to ImageTree only. Change-Id: I3a26444f0f6971a6b1d83472e9cef19c93192d3e Reviewed-on: https://gerrit.libreoffice.org/32134 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com>
2016-12-19ScrollableWrapper -> ScrollableDialogNoel Grandin
no point in having a template and a virtual base class when it's only used for one type Change-Id: Idb1a1a551064cc10896eff33652038eb5be0297e Reviewed-on: https://gerrit.libreoffice.org/32041 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-18On Windows, #include <process.h> for getpidStephan Bergmann
Change-Id: Ibfb52800cdde99298431dab9da1cb8109658c425
2016-12-18loplugin:vclwidgets: Adapt check for 'assert' for MSVCRTStephan Bergmann
Change-Id: I12a77b5b53e3a674c1ff1554b560a71605e141a6
2016-12-18loplugin:stringconstant: Adapt to definition of OSL_THIS_FUNC on WindowsStephan Bergmann
Change-Id: I93a23799ad9a76ed9f4f86d69adb610d0962da20
2016-12-18loplugin:stringconcat: Adapt to definition of OSL_THIS_FUNC on WindowsStephan Bergmann
Change-Id: I9a2be8c4265095ff2ac5e2216cb08c35c9049bf8
2016-12-18Work around problem with poor gperf-generated code under clang-clStephan Bergmann
Change-Id: Iba3fae8bbecaf5782228be1fb99f196864d79e6b
2016-12-18loplugin:fpcomparison: Whitelist some Windows-only functionsStephan Bergmann
Change-Id: I94f35696ba358a049ee65764d17c62df7889aec7
2016-12-18loplugin:commaoperator: Ignore occurrence in FD_SET expansion on WindowsStephan Bergmann
Change-Id: I66974c273918d6d887364e7d552e3caf63e16343
2016-12-18Chose better diagnostic locationStephan Bergmann
Change-Id: I502da4b93905e64ca5506f24dc1f6bf2bf990dc2
2016-12-18Generalize typedef-to-void* check in loplugin:redundantcastStephan Bergmann
...to also cover cases like conversion betwen LPVOID and HANDLE in Windows-only code Change-Id: I934fe89372ee7a12462e7ad4284b9ea2cc73ce5a
2016-12-18Rename cdecl -> classdecl (MSVC treats the former like a keyword)Stephan Bergmann
Change-Id: I1859a92c996b907b8d511cddba25c00c9a52f398
2016-12-17Adapt to no-longer explicit OUStringLiteral ctorStephan Bergmann
...from previous commit Change-Id: I062b7cd212c17e7eb5274476e6859228d0477c7f Reviewed-on: https://gerrit.libreoffice.org/32098 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-12-16Make move detection in loplugin::passstuffbyref work for parenthesized casesStephan Bergmann
Change-Id: I56754a718af9433c0fa654ccb8eb34da00e75420
2016-12-16Make move detection in loplugin:passstuffbyref work with MSVCRTStephan Bergmann
...where an ImplicitCastExpr happens to appear between CXXConstructExpr and CallExpr Change-Id: I62226cc89d87bd3d9c03743b650f10c32c18f9be
2016-12-15disable the 'two different log areas in the same file' loplugin checkNoel Grandin
too many false+ to leave it alive by default Change-Id: I6d8f92b630c351c1ac788fad79f8d7c435ba4963
2016-12-15teach sallogareas plugin to catch inconsistenciesNoel Grandin
Change-Id: I8bcea5ffc74d48148bea78da8c17744e288c069a Reviewed-on: https://gerrit.libreoffice.org/32004 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-12-14Merge shell into TaskManager base classStephan Bergmann
(arbitrarily decided to keep the latter, being the less odd class name) Change-Id: I5c061a0f12b8f3095e283b4896f7c910948ac50f
2016-12-14Disambiguate clang::StringLiteralStephan Bergmann
...vs. recently introduced llvm::StringLiteral (llvm/ADT/StringRef.h) Change-Id: I4d74546b0d1401a74b0c15368bbc93794ecd0b1d
2016-12-14Check that VclPtr is only instantiated with appropriate typesStephan Bergmann
...deriving from VclReferenceBase. Complicated by the fact that the argument type may be incomplete at the time of template instantiation. So this approach may be less precise than the change to loplugin:vclwidgets from cbf5b21f2a65bbb342295200f6ad93a00f90733e "Catch some misuses of VclPtr construction" when the argument type becomes complete later in the comilation unit. However, this approach would also catch the two misuses in UnoControls found by cbf5b21f2a65bbb342295200f6ad93a00f90733e, so go with this approach for now and revert the change to loplugin:vclwdigets. Change-Id: I7888f23d2b9e2db81ae2ce4bf4c8277912317685 Reviewed-on: https://gerrit.libreoffice.org/31966 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-12-12Prevent use of ORowSetValue with sal_Bool as TINYINTStephan Bergmann
sal_Bool and sal_uInt8 are typedefs for the same underlying type, so any use of ORowSetValue with sal_Bool instead of bool, apparently intending to treat the value as a boolean, actually treated it as a TINYINT. (See e.g. recent 7b0c57b2faec875c790051d233d1e9abaed2a3bc "some compilers don't like implicit bool-to-ORowSetValue conversion".) Now that there's no way to create a sal_uInt8 ORowSetValue, getUInt8 and the m_uInt8 union member can probably go away, too. Change-Id: Ia27554f76e7e9edce6410284b578064573e54fd3 Reviewed-on: https://gerrit.libreoffice.org/31909 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2016-12-12Whitelist aLogger, in FormulaLogger& FormulaLogger::get()Tor Lillqvist
To avoid this: sc/source/core/tool/formulalogger.cxx:55:26: error: bad static variable causes crash on shutdown [loplugin:badstatics] static FormulaLogger aLogger; ~~~~~~~~~~~~~~~~~~~~~^~~~~~~ sc/inc/formulalogger.hxx:42:31: note: ... due to this member of 'FormulaLogger' [loplugin:badstatics] const ScFormulaCellGroup* mpLastGroup = nullptr; ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ sc/inc/formulacell.hxx:66:20: note: ... due to this member of 'ScFormulaCellGroup' [loplugin:badstatics] ScFormulaCell *mpTopCell; ~~~~~~~~~~~~~~~^~~~~~~~~ sc/inc/formulacell.hxx:114:21: note: ... due to this member of 'ScFormulaCell' [loplugin:badstatics] ScDocument* pDocument; ~~~~~~~~~~~~~~~~^~~~~~~~~ sc/inc/document.hxx:312:27: note: ... due to this member of 'ScDocument' [loplugin:badstatics] VclPtr<SfxPrinter> pPrinter; ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~ Change-Id: I533e45f655ca928a801188aa48ee818d89a962ac