summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/useuniqueptr.cxx
AgeCommit message (Collapse)Author
2022-06-10[API CHANGE] Remove deprecated idlc and regmerge from the SDKStephan Bergmann
* Client code must replace uses of idlc and regmerge with uses of unoidl-write, see the changes to odk/examples/ and ure/source/uretext/ in 40f2aee6584eafcf4cd1d95fcf1f775e5435440d "Provide unoidl-write also for the SDK" for examples. * The new types.rdb format is not compatible with LibreOffice < 4.1. Clients generating extensions containing such files are advised to use appropriate LibreOffice-minimal-version elements. * For compatibility with old extensions, reading the legacy types.rdb format is still supported. * The SDK no longer ships an idl/ sub-directory containing the udkap and offapi .idl files (as, unlike idlc, unoidl-write does not need them). odk/config/cfgWin.js had to be adapted to look (somewhat arbitrarily) for an examples/ sub-directory instead of idl/ when checking for "an sdk folder". gb_UnoApi_package_idlfiles became unused and has been removed. * The idlc and regmerge executables have been removed. Module idlc has been removed except for idlc/test/parser/, which is also used by CustomTarget_unoidl/unoidl-write_test, and which may eventually be moved into module unoidl. Module external/ucpp and the corresponding configure options have also been removed. Change-Id: I42a0231699b863b5ebe2bee63bc32c8f79278cc1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122363 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-17Revert "Fix failure of loplugin:useuniqueptr with older compilers"Stephan Bergmann
...0bf61855164af5751e78ca8626c10d604b1ab13b, which should be obsolete now: It speculated why 05a337e297eb0cfe88c99503d760bd9eaf495b7d "loplugin:useuniqueptr look for deleting in loops with iterators" had introduced Foo24 in compilerplugins/clang/test/useuniqueptr.cxx wrapped in #if CLANG_VERSION >= 50000 and came to the conclusion that "either the old compiler lacked Clang's recent <https://reviews.llvm.org/D50666> "Fix Stmt::ignoreImplicit" (and the above initialization expression happens to include a CXXBindTemporaryExpr, at least with libstdc++), or an even older compiler was used in pre-C++17 mode". But both of those potential reasons should be moot now, as the Clang fix got introduced towards Clang 8, and LO requires C++17 now (except for 3rd-party code). Change-Id: I307afbbecc5f031bca2319c4b22d54bd467eac81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130116 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-02-17Bump compiler plugins Clang baseline to 12.0.1Stephan Bergmann
...as discussed in the mail thread starting at <https://lists.freedesktop.org/archives/libreoffice/2020-November/086234.html> "Bump --enable-compiler-plugins Clang baseline?" (and now picked up again at <https://lists.freedesktop.org/archives/libreoffice/2022-February/088459.html> "Re: Bump --enable-compiler-plugins Clang baseline?"), and clean up compilerplugins/clang/ accordingly Change-Id: I5e81c6fdcc363aeefd6227606225b526fdf7ac16 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129989 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2021-05-10rename to remove the gtk3 prefixCaolán McNamara
Change-Id: I219798ed42aff11d09fd45c26ca1a018c2d22c08 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115239 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2021-01-14cid#1471346 Uncaught exceptionCaolán McNamara
Change-Id: I535affd6597636aa32e1cf9c6005238f9503ef6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109266 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2020-07-10replace usage of whitelist with allowlistThorsten Behrens
Background and motivation: https://tools.ietf.org/html/draft-knodel-terminology-02 [API CHANGE] officecfg::Office::Common::Misc::OpenCLWhiteList -> OpenCLAllowList Change-Id: I65636b19b13e4af1e4851f70e78053f3443d6bb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98181 Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2020-02-13Get rid of some unnecessary llvm::StringRef -> std::string conversionsStephan Bergmann
(as discussed in the commit message of ce1d8e20a708ed031f2336770a41fbe501fe8225 "Adapt to '[ADT] Make StringRef's std::string conversion operator explicit'"; there are more of those that cannot easily be dropped, though). Change-Id: Ib2e223f7de96ad8859eab165daa759b480326c7b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88582 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-01-29Adapt to "[ADT] Make StringRef's std::string conversion operator explicit"Stephan Bergmann
...<https://github.com/llvm/llvm-project/commit/ 777180a32b61070a10dd330b4f038bf24e916af1>. This is just a quick fix to get copmilerplugins buiding again with latest LLVM/Clang trunk. Ideally, we should get rid of as many of those (potentially expensive) conversions from llvm::StringRef to std::string as possible. Change-Id: I18e185e0022a06fd8e3b983a3c4f80e1f3b96746 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87682 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-10-08better name for a function in compilerpluginsLuboš Luňák
The function is not just about a spelling location. Change-Id: I96e9e9ef7e27a9763397b4b86473c1c30d0e3eeb Reviewed-on: https://gerrit.libreoffice.org/80381 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-09-06Fixing "...."Andrea Gelmini
Change-Id: Id005a7531d546dd43de13b49bcb3e93081c5ad8d Reviewed-on: https://gerrit.libreoffice.org/78679 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-04-21Fix typoAndrea Gelmini
Change-Id: I7b94fdd366fd8e149ec6e2af458338e6a56b400c Reviewed-on: https://gerrit.libreoffice.org/71027 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2019-02-11use more hasPathnamePrefixNoel Grandin
Change-Id: I539e6aedad61d80b6ebe80104b77d720072395bd
2019-01-31Fix compilerplugins/clang/test/useuniqueptr.cxx for clang-clStephan Bergmann
...where it failed with > error: 'error' diagnostics expected but not seen: > File C:/lo-clang/core/compilerplugins/clang/test/useuniqueptr.cxx Line 266: rather manage this var with std::some_container<std::unique_ptr<T>> [loplugin:useuniqueptr] > File C:/lo-clang/core/compilerplugins/clang/test/useuniqueptr.cxx Line 275: rather manage this member with std::some_container<std::unique_ptr<T>> [loplugin:useuniqueptr] apparently due to differences in how some std types are implemented. Change-Id: Ib81ed1a1da867359e7f22bb6fb6ceb3e610e2b41 Reviewed-on: https://gerrit.libreoffice.org/67226 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-18update useunique_ptr lopluginNoel Grandin
with more exclusions Change-Id: I95e7376ecf9c479d05b85c71f863d9ba40417538 Reviewed-on: https://gerrit.libreoffice.org/66552 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-11loplugin:useuniqueptr in svtools,toolkitsNoel Grandin
Change-Id: Ied7768293e7781772205c9e8f9fb743a584e3125 Reviewed-on: https://gerrit.libreoffice.org/64880 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-11loplugin:useuniqueptr in vclNoel Grandin
Change-Id: I24eca813321fd3919bba9d37c285484f865ea2ea Reviewed-on: https://gerrit.libreoffice.org/64877 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-10cppcheck: incorrectStringBooleanErrorJulien Nabet
Change-Id: I7f4bce8444c6c022d856d20b06de4a4834148ea2 Reviewed-on: https://gerrit.libreoffice.org/64834 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-11-23Bump compiler plugins Clang baseline to 5.0.2Stephan Bergmann
...as discussed at <https://lists.freedesktop.org/archives/libreoffice/2018-November/081435.html> "minutes of ESC call ..." Change-Id: Ia053da171d59747984546f38e19da808825b4f79 Reviewed-on: https://gerrit.libreoffice.org/63832 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-11-09loplugin:useuniqueptr extend to checking more local var deletesNoel Grandin
Change-Id: I5da0f6ecd2577e92e679ed26dd42629dbac4afd4 Reviewed-on: https://gerrit.libreoffice.org/63132 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-23loplugin:useuniqueptr more exclusionsNoel Grandin
Change-Id: I70c6d4af999965497e23ec8180eb08aa6dc648c5 Reviewed-on: https://gerrit.libreoffice.org/62221 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-10-10Fix failure of loplugin:useuniqueptr with older compilersStephan Bergmann
...where CompilerTest_compilerplugins_clang failed in compilerplugins/clang/test/useuniqueptr.cxx due to Foo24's HTMLAttrs::const_iterator it = m_aSetAttrTab.begin(); and either the old compiler lacked Clang's recent <https://reviews.llvm.org/D50666> "Fix Stmt::ignoreImplicit" (and the above initialization expression happens to include a CXXBindTemporaryExpr, at least with libstdc++), or an even older compiler was used in pre-C++17 mode, so the above initialization expression happens to include an elidable CXXConstructExpr copy constructor call. Change-Id: I757a9ad76829e399b4fe2da1c82863909b8c9657 Reviewed-on: https://gerrit.libreoffice.org/61531 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-08Fix loplugin:useuniqueptr for libc++ (macOS)Stephan Bergmann
...after 05a337e297eb0cfe88c99503d760bd9eaf495b7d "loplugin:useuniqueptr look for deleting in loops with iterators", where it didn't emit the warning for Foo24 in compilerplugins/clang/test/useuniqueptr.cxx during CompilerTest_compilerplugins_clang, because in the initialization of HTMLAttrs::const_iterator it = m_aSetAttrTab.begin(); the HTMLAttrs::const_iterator CXXConstructExpr happens to have a second, defaulted argument. Change-Id: I882a6dfb5cab1b147f790072f2545b13172c0f9a Reviewed-on: https://gerrit.libreoffice.org/61530 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-06Fix typoAndrea Gelmini
Change-Id: I822fa325d37955583a21e4d7ce2e79a4d5b02fc5 Reviewed-on: https://gerrit.libreoffice.org/61462 Reviewed-by: Julien Nabet <serval2412@yahoo.fr> Tested-by: Julien Nabet <serval2412@yahoo.fr>
2018-10-05loplugin:useuniqueptr look for deleting in loops with iteratorsNoel Grandin
Change-Id: I0e5bf671ee11265c0afa8770430ec9e064e05fe3 Reviewed-on: https://gerrit.libreoffice.org/61402 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-18loplugin:useuniqueptr check more local variablesNoel Grandin
Change-Id: I8387731747ee6eb7d74037c0eff7fc9ac0b884c8 Reviewed-on: https://gerrit.libreoffice.org/60619 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-09-03loplugin:useuniqueptr update exclusionsNoel Grandin
Change-Id: I9c741dbaba772550b4d68406fff50d8b0ac60874 Reviewed-on: https://gerrit.libreoffice.org/59923 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-30Fix typosAndrea Gelmini
Change-Id: Ia658776bce8744e7b771559ca12b94a20923fc52 Reviewed-on: https://gerrit.libreoffice.org/59782 Tested-by: Jenkins Reviewed-by: Jens Carl <j.carl43@gmx.de>
2018-08-23filter out AST in more pluginsNoel Grandin
I seem to have missed quite a few in commit 9f4d23c15115d64febd6bf01f870cc157badd350 filter out some of the AST in the plugins This nets me another 14% improvement Change-Id: I39b980b49ced560f768045dbedd3ddfef29306c1 Reviewed-on: https://gerrit.libreoffice.org/59501 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-22improvements to loplugin:useuniqueptrNoel Grandin
find more patterns of deleting member data Change-Id: I8913e364200dad8405bac30dd8cab2a68c8bee8f Reviewed-on: https://gerrit.libreoffice.org/59233 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-21loplugin useuniqueptr improvementNoel Grandin
passing owning pointers to constructors Change-Id: I4e64cabbf449393b77162a845b3138be415e2dc9 Reviewed-on: https://gerrit.libreoffice.org/59346 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-08-10Avoid -Werror=deprecated-declarations with recent Clang trunkStephan Bergmann
...which first added alternative names to and then deprecated getLocBegin/End Change-Id: Iaefb8ce259057abfa6cd20f0b63c0ef2949a96b2 Reviewed-on: https://gerrit.libreoffice.org/58820 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-07-30loplugin:useuniqueptr in SwGrfExtPageNoel Grandin
Change-Id: Ic71cf09b6a443f6918b074010fe53ea0843bf246 Reviewed-on: https://gerrit.libreoffice.org/58238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24loplugin:useuniqueptr in rptui::ConditionNoel Grandin
Change-Id: I1197be1f7ea8b621dedef41fdd0a664cb6d90374 Reviewed-on: https://gerrit.libreoffice.org/57879 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24loplugin:useuniqueptr fix check for DELETEZ inside compound stmtNoel Grandin
Change-Id: Id748b8b0c9cfe8c288dfafb5d0c2a83a8de2c91c Reviewed-on: https://gerrit.libreoffice.org/57871 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-24loplugin:useuniqueptr in SwHTMLWriterNoel Grandin
Change-Id: I67f3dd615e798f8ac865b57332f6153530d81929 Reviewed-on: https://gerrit.libreoffice.org/57863 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-20loplugin:useuniqueptr in HTMLTableNoel Grandin
Change-Id: I46ece073659444e802bf480996a5797c9f1ec9e8 Reviewed-on: https://gerrit.libreoffice.org/57754 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-20loplugin:useuniqueptr in XclObjNoel Grandin
Change-Id: I2995dfe5fb39ae2e7f3c37992cb3e2147381784e Reviewed-on: https://gerrit.libreoffice.org/57753 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-19loplugin:useuniqueptr in SwUndoTableMergeNoel Grandin
Change-Id: I0c528c2b12d219f37a2c2fdf2211fce3c51ad9e4 Reviewed-on: https://gerrit.libreoffice.org/57688 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-17loplugin:useuniqueptr in ScTabViewNoel Grandin
Change-Id: Ic506f5d350abbbbb5912e3ebf753e02821c76841 Reviewed-on: https://gerrit.libreoffice.org/57523 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-17loplugin:useuniqueptr in SwHTMLWriterNoel Grandin
Change-Id: I4802e6502addce96bff4831598e852e4fe673af4 Reviewed-on: https://gerrit.libreoffice.org/57521 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-16loplugin:useuniqueptr in UndoTransliterate_DataNoel Grandin
Change-Id: I1c6e865a6f59ce7f31c42d28b2b463a577b3cc28 Reviewed-on: https://gerrit.libreoffice.org/57421 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-13loplugin:useuniqueptr in SbUnoStructRefObjectNoel Grandin
now that we have upgraded to VS2017, we can use std::unique_ptr in std::map Change-Id: Id01af07ccae7447405b8f0bc44b08043f453e54b Reviewed-on: https://gerrit.libreoffice.org/57384 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-13loplugin:useuniqueptr in SwGrammarContactNoel Grandin
Change-Id: I1e6a2ca8f00d6130cfa6d2c18139bf61ada10630 Reviewed-on: https://gerrit.libreoffice.org/57363 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-07-06compilerplugins: try to make these work with icecreamMichael Stahl
There are some problems here, this should fix one of them: the getFilename function returns "<stdin>" for spelling locations, because the input to clang is sort of preprocessed via -frewrite-includes if icecream is used and the file is built on a remote host (whereas it's apparently not preprocessed if the file is compiled locally by icecream). Using getPresumedLoc() uses the #line directives in the preprocessed input, which avoids the problem but is more expensive, so try to use it only when necessary. The getFileEntry(getMainFileID())->getName() pattern will also result in "<stdin>", but fortunately icecream passes -main-file-name, which oddly enough isn't used by the SourceManager's spelling locations, but is available separately via CodeGenOptions. This builds everything successfully with clang version 6.0.0: ICECC_PREFERRED_HOST=myremote make check gb_SUPPRESS_TESTS=t Change-Id: Ic121511683e5302d7b9d85186c8b9c4a5443fa1b Reviewed-on: https://gerrit.libreoffice.org/54993 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2018-07-04loplugin:useuniqueptr in ScSimpleEditSourceHelperNoel Grandin
Change-Id: Iebe62753d9e6f83f985e4c55fb938d5861613898 Reviewed-on: https://gerrit.libreoffice.org/56903 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-29loplugin:useuniqueptr in SwTextAPIObjectNoel Grandin
Change-Id: Ied235aefe2cc2ce5e88487503c17e1a54d25ac52 Reviewed-on: https://gerrit.libreoffice.org/56624 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-27loplugin:useuniqueptr in SwDocNoel Grandin
Change-Id: Ic895c7b79a25a0766cc6d352c5ed75873004fddb Reviewed-on: https://gerrit.libreoffice.org/56496 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-06-22teach useuniqueptr loplugin about calling delete on a paramNoel Grandin
which is often a useful indicator that the callers can be made to use std::unique_ptr Change-Id: Idb1745d1f58dbcf389c9f60f1a5728d7d092ade5 Reviewed-on: https://gerrit.libreoffice.org/56238 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-28loplugin:useuniqueptr in ODbTypeWizDialogNoel Grandin
Change-Id: I4c364ddbad4881cc8a70a1827d7c51e7cc9313f1 Reviewed-on: https://gerrit.libreoffice.org/54850 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-05-28loplugin:useuniqueptr in GridWindowNoel Grandin
Change-Id: I9fd6d8ac159994c894739afbb3dccb72576dccfb Reviewed-on: https://gerrit.libreoffice.org/54844 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>