summaryrefslogtreecommitdiff
path: root/compilerplugins
AgeCommit message (Collapse)Author
2017-02-01More ctor check fixesStephan Bergmann
Change-Id: Ifcce63b975fb7c4ac7e7545e3eadcc6f7f12e466
2017-02-01Fix ctor checkStephan Bergmann
Change-Id: Ie261d5412c510c045b4d93a6bf1a3d4cf4371897
2017-02-01loplugin: use TypeCheck instead of getQualifiedNameAsStringNoel Grandin
since the latter is rather slow Change-Id: Ib73cdb923585580777c2265b561c1808e93b2baa Reviewed-on: https://gerrit.libreoffice.org/33585 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01loplugin:useuniqueptr extend to check local varsNoel Grandin
just the simple and obvious case for now, of a local var being allocated and deleted inside a single local block, and the delete happening at the end of the block Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625 Reviewed-on: https://gerrit.libreoffice.org/33749 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-01loplugin:stringconstant handle calls to constructors with one argNoel Grandin
Change-Id: Ide9148a908bef46ba14640dfa6f556beaf6e3f60 Reviewed-on: https://gerrit.libreoffice.org/33772 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-31teach lolugin:stringconstant about calling constructorsNoel Grandin
so we can remove unnecessary calls to the OUString(literal) constructor when calling constructors like this: Foo(OUString("xxx"), 1) Change-Id: I1de60ef561437c86b27dc9cb095a5deb2e103b36 Reviewed-on: https://gerrit.libreoffice.org/33698 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-28loplugin:stringconstant check for unnecessary OUString constructor..Noel Grandin
..calls when creating exceptions Change-Id: I3bc58a5aa4dc6f0508ecb88b3a843b96b8c7ebfe Reviewed-on: https://gerrit.libreoffice.org/33617 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-27...and Clang 4 will have it, tooStephan Bergmann
Change-Id: Ia927ed7d1e7815e59ccb67246da6981c65683168
2017-01-27getExceptionSpecSourceRange is new in Clang 5Stephan Bergmann
Change-Id: Ifa9223fadeeb1fde54afc99874a1b3d855073dce
2017-01-27fix spelling containging->containingNoel Grandin
Change-Id: I49f736c049735e89ce9f71740f5c308120378a9a
2017-01-27improve "unnecessary user-declared destructor" checkNoel Grandin
to look for inline&empty destructors, where we can just let the compiler do it's thing Change-Id: Ibde8800bdfed6b77649c30ebc19921167c33dec3 Reviewed-on: https://gerrit.libreoffice.org/32999 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-01-27Enable loplugin:dynexcspec rewriting modeStephan Bergmann
Change-Id: I73404287c387a36e224683f75e967d51d911175b
2017-01-27Make plugin rewriting work on Windows tooStephan Bergmann
...in a somewhat hacked-up way for now (see the TODO comment) Change-Id: Ida89fb8257b876cfca05b3048ce15996091c5703
2017-01-27Remove dynamic exception specifications from !LIBO_INTERNAL_ONLYStephan Bergmann
...only odk/examples/ remains to be clean up Change-Id: I875a1e8d6750b6b007bd75126b8010273e1f32d5
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