summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/pointerbool.cxx
AgeCommit message (Collapse)Author
2023-06-05Adapt compilerplugins to Clang 17 trunk "Remove llvm::Optional"Stephan Bergmann
(<https://github.com/llvm/llvm-project/commit/397f2e9ebee8d8e45547e90dd05228d7f965df67>) Change-Id: I51acda5951f8250d1a1b47e1c2612199ae7338a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152618 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2022-08-08Adapt to changes in llvm::OptionalStephan Bergmann
<https://github.com/llvm/llvm-project/commit/3c49576417bab1b07764aa0b22664cbc8d3c3f53> "[ADT] Add has_value, value, value_or to llvm::Optional" is in Clang 15, and <https://github.com/llvm/llvm-project/commit/b5f8d42efe3e246d582d4a1a328fac915e4ce8dc> "[ADT] Deprecate Optional::{hasValue,getValue} (NFC)" is in Clang 16 trunk, causing > In file included from compilerplugins/clang/sharedvisitor/sharedvisitor.cxx:95: > compilerplugins/clang/pointerbool.cxx:118:21: error: 'hasValue' is deprecated: Use has_value instead. [-Werror,-Wdeprecated-declarations] > if (ret.hasValue() && (ret.getValue() == 1 || ret.getValue() == 0)) > ^ > ~/llvm/inst/include/llvm/ADT/Optional.h:324:5: note: 'hasValue' has been explicitly marked deprecated here > [[deprecated("Use has_value instead.")]] constexpr bool hasValue() const { > ^ etc. Change-Id: I377effe29fc6752484d2870b9a0fd66fddc26bfc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137982 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-01-22improve loplugin:pointerboolNoel
to look through template instantiations involving std::forward motivated by commit b1617acde182d1683bdfb529794d7456f8b4bf6d drop RadioButton arg defaults the nBits arg in builder.cxx was in the wrong place Change-Id: I222ea2aeea6f44ae54839e824a247a8105392c2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109789 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-16convert some plugins to LO_CLANG_SHARED_PLUGINSNoel Grandin
Change-Id: I63c9e010d83c24e18a36164ceb0441e48b757142 Reviewed-on: https://gerrit.libreoffice.org/75725 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-11-27add EvaluateAsInt compat function for latest clangNoel Grandin
the old EvaluateAsInt method has been dropped as from current clang Change-Id: Ie30d1547ad8de777badff4b380d2fc9fb261e8fe Reviewed-on: https://gerrit.libreoffice.org/64107 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
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-02-06remove debugging codeNoel Grandin
Change-Id: Ia5018354a764f900091cb5e03327721fa66591c9
2018-01-23new loplugin: pointerboolNoel Grandin
look for possibly bogus implicit conversions to bool when passing (normally pointer) args to bool params. this plugin comes in the wake of a couple of bugs caused by refactoring, where some of the call sites were not currently updated. Of the changes, the following are real bugs: desktop/../dp_persmap.cxx StartInputFieldDlg in sw/../fldmgr.cxx which occurred as a result of commit 39d719a80d8c87856c84e3ecd569d45fa6f8a30e Date: Tue May 3 11:39:37 2016 +0200 tdf#99529 sw: don't pop up input field dialog before inserting field CSerializationURLEncoded::encode_and_append in forms/../serialization_urlencoded.cxx XclExpCFImpl::XclExpCFImpl in sc/../xecontent.cxx I have no idea how to properly fix this, just made a guess. SwDocTest::test64kPageDescs in sw/qa/core/uwriter.cxx which looks like a simple copy/paste error. Change-Id: I795ebd5ef485a1d36863dc27fe13832989f5a441 Reviewed-on: https://gerrit.libreoffice.org/48291 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>