summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/test
AgeCommit message (Collapse)Author
2024-02-07double operator < is not a strict weak ordering due to NaNStephan Bergmann
...so recent LLVM 19 trunk libc++ in debug mode complained during CppunitTest_chart2_export2 about > ~/llvm/inst/bin/../include/c++/v1/__debug_utils/strict_weak_ordering_check.h:59: assertion __comp(*(__first + __a), *(__first + __b)) failed: Your comparator is not a valid strict-weak ordering at > 5 libsystem_c.dylib 0x0000000183279a40 abort + 180 > 6 libc++.1.0.dylib 0x00000001030f9d98 _ZNSt3__123__cxx_atomic_notify_oneEPVKv + 0 > 7 libchartcorelo.dylib 0x00000002f817f0ec _ZNSt3__135__check_strict_weak_ordering_sortedB8de190000INS_11__wrap_iterIPNS_6vectorIdNS_9allocatorIdEEEEEEN5chart12_GLOBAL__N_116lcl_LessXOfPointEEEvT_SB_RT0_ + 960 > 8 libchartcorelo.dylib 0x00000002f817e6cc _ZNSt3__118__stable_sort_implB8de190000INS_17_ClassicAlgPolicyENS_11__wrap_iterIPNS_6vectorIdNS_9allocatorIdEEEEEEN5chart12_GLOBAL__N_116lcl_LessXOfPointEEEvT0_SC_RT1_ + 268 > 9 libchartcorelo.dylib 0x00000002f8172a90 _ZNSt3__111stable_sortB8de190000INS_11__wrap_iterIPNS_6vectorIdNS_9allocatorIdEEEEEEN5chart12_GLOBAL__N_116lcl_LessXOfPointEEEvT_SB_T0_ + 68 > 10 libchartcorelo.dylib 0x00000002f8172820 _ZN5chart11VDataSeries15doSortByXValuesEv + 508 > 11 libchartcorelo.dylib 0x00000002f8064c44 _ZN5chart9AreaChart12createShapesEv + 1528 > 12 libchartcorelo.dylib 0x00000002f80f2ae0 _ZN5chart9ChartView28impl_createDiagramAndContentERKNS_18CreateShapeParam2DERKN3com3sun4star3awt4SizeE + 4440 > 13 libchartcorelo.dylib 0x00000002f80f77ac _ZN5chart9ChartView14createShapes2DERKN3com3sun4star3awt4SizeE + 2728 > 14 libchartcorelo.dylib 0x00000002f80f58ec _ZN5chart9ChartView12createShapesEv + 692 > 15 libchartcorelo.dylib 0x00000002f80f4598 _ZN5chart9ChartView15impl_updateViewEb + 288 But the introduced use of `std::strong_order(first[0], second[0]) < 0` then triggered a false > lo/core/chart2/source/view/main/VDataSeries.cxx:105:61: error: NullToMemberPointer ValueDependentIsNotNull ZeroLiteral -> nullptr [loplugin:nullptr] > 105 | return std::strong_order(first[0], second[0]) < 0; > | ^ so needed some hack in loplugin:nullptr. And old versions of libc++, still used at least on Android, do not have any implementations of std::strong_order. So detect those cases in configure.ac (checking for std::strong_order for double, which is what is actually being used in the code) and fall back to operator <=> for now, even if that will not provide a strict weak ordering and will thus continue to violate the requirements of std::sort. And then our venerable clang-format 5.0.0 would have broken the token `<=>` into `<= >`, so exclude include/o3tl/compare.hxx from its mis-treatment. Change-Id: I7a64a630eb5f560dce59f3ff9d51ca3d1adc70be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163075 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2024-02-02loplugin:unnecessarygetstr fix false +Noel Grandin
spotted in https://gerrit.libreoffice.org/c/core/+/162869 Change-Id: I87d9fdcfed5282f0e94fc8aa95a46054883fdd79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162929 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-30Extended loplugin:ostrStephan Bergmann
Change-Id: I987d6d60ca2d1e8ed8b8cde1e0c7996c0fff71b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160006 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
2023-11-15Extend a loplugin:ostr check from OUString to OStringStephan Bergmann
Change-Id: I0776ab0ab376d6181461d2c144a4107b06233829 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159470 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-15Add back test for struct initializationStephan Bergmann
...that had been removed as part of f99bee8103ad82dac2e53e114527399c4af5485c "Delete OUString UTF-16 string literal ctor/assignment op" Change-Id: I22423306ab35dcb580ecc90daea3219b6c1578b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159446 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-14Adapt compilerplugins/clang/test/fieldcast.cxx to clang-clStephan Bergmann
...where loplugin:locking2 is disabled Change-Id: Id58cbedab191c59b901ef1a0e0dd82b8f8438c4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159400 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-11loplugin:fieldcast improvementsNoel Grandin
reduce false positives, and also check reinterpret_cast Change-Id: Ia6f214393f28451d18c16b764a3c2b149d29ba8a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159302 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-08Adapt expected diagnostic output to clang-cl and the MSVC standard libraryStephan Bergmann
Change-Id: Ie416e4170280b9f05ecac359655e71f65a525592 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159131 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-08Adapt compilerplugins/clang/test/locking2.cxx to clang-clStephan Bergmann
...where loplugin:locking2 is disabled Change-Id: Ie6a241ac49670e47001cba67c7af9996623a23ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159109 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-08Adapt loplugin:stringconcatliterals to clang-clStephan Bergmann
...whose handling of PredefinedExpr (representing `__func__`) deliberately differs in IgnoreParens and IgnoreParenImpCasts, see the comment in StringConcatLiterals::isStringLiteral Change-Id: I8b001d65369adc3d2a2c47e0cf32578a72ef4eec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159111 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-08new loplugin:fieldcastNoel Grandin
new plugin to look for class fields that are always cast to some subtype, which indicates that they should probably just be declared to be that subtype. Perform one of the suggested improvements in xmlsecurity/ Change-Id: Ia68df422c37f05cbcf9c02ba5d0853f8eca4f120 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159063 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-11-05loplugin:ostr: Warn about literals that could be string_viewStephan Bergmann
...inspired by d4f4a401861e7c908b6ab7f72563d5ab911edcf0 "This function takes a string view - no need in OUString literal", but this found no further cases Change-Id: I1429950afdb6fff8ed1d28f5fbb4c445fb6bfb12 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158954 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-11-03Suppress loplugin:redundantfcast also around C++20 CXXParenListInitExprStephan Bergmann
...which is used by <https://github.com/llvm/llvm-project/commit/95a4c0c83554c025ef709a6805e67233d0dedba0> "[clang] Reland parenthesized aggregate init patches" for the __cpp_aggregate_paren_init feature implemented since Clang 16, and which had caused bogus warnings in patch set 1 of <https://gerrit.libreoffice.org/c/core/+/158838/1> "tdf#157028 vcl: PDF export: inline OBJR dictionaries" Change-Id: Id4118ce8d53902388ca3a80ad03f12b59e3a35e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158842 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-21Extended loplugin:ostr: Automatic rewrite some O[U]StringLiteral -> O[U]StringStephan Bergmann
Change-Id: I8c08bf41b96d4a6085e7d72cb39e629efa556d09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158300 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-15Repurpose loplugin:stringstatic for O[U]String vars that can be constexprStephan Bergmann
...now that warning about O[U]String vars that could be O[U]StringLiteral is no longer useful Change-Id: I389e72038171f28482049b41f6224257dd11f452 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157992 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-11__cpp_char8_t is generally available nowStephan Bergmann
...after 1eef07805021b7ca26a1a8894809b6d995747ba1 "Bump baseline to C++20" Change-Id: I75509f3731357e0e3ae73c3774abd6e4070f605b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157806 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-11Delete OUString UTF-16 string literal ctor/assignment opStephan Bergmann
...that have been made unused by 7ef3d937415185ef66e32dd3043783eddcd03db5 "loplugin:ostr: Rewrite some uses of O[U]String to use ""_ostr/u""_ustr literals". (And which means we can remove the relevant code from that plugin again.) (This also found a handful of remaining uses that had been hard for the plugin to discover, along the lines of > std::map<OUString, int> m = {{u"foo", 0}}; being represented by a > DeclStmt 0xdaca578 <line:103:5, col:50> > `-VarDecl 0xdac9150 <col:5, col:49> col:29 s11 'std::map<OUString, int>':'std::map<rtl::OUString, int>' cinit destroyed > `-ExprWithCleanups 0xdaca548 <col:35, col:49> 'std::map<OUString, int>':'std::map<rtl::OUString, int>' > `-CXXConstructExpr 0xdaca508 <col:35, col:49> 'std::map<OUString, int>':'std::map<rtl::OUString, int>' 'void (initializer_list<value_type>, const std::less<rtl::OUString> &, const allocator_type &)' list std::initializer_list > |-CXXStdInitializerListExpr 0xdaca480 <col:35, col:49> 'initializer_list<value_type>':'std::initializer_list<std::pair<const rtl::OUString, int>>' > | `-MaterializeTemporaryExpr 0xdaca468 <col:35, col:49> 'const std::pair<const rtl::OUString, int>[1]' xvalue > | `-CXXBindTemporaryExpr 0xdaca448 <col:35, col:49> 'const std::pair<const rtl::OUString, int>[1]' (CXXTemporary 0xdaca448) > | `-InitListExpr 0xdac9df0 <col:35, col:49> 'const std::pair<const rtl::OUString, int>[1]' > | `-CXXConstructExpr 0xdaca408 <col:36, col:48> 'const std::pair<const rtl::OUString, int>' 'void (const char16_t (&)[4], int &&) noexcept(_S_nothrow_constructible<const char16_t (&)[4], int>())' list > | |-StringLiteral 0xdac91b8 <col:38> 'const char16_t[4]' lvalue u"foo" > | `-MaterializeTemporaryExpr 0xdaca3f0 <col:46> 'int' xvalue > | `-IntegerLiteral 0xdac91d8 <col:46> 'int' 0 > |-CXXDefaultArgExpr 0xdaca498 <<invalid sloc>> 'const std::less<rtl::OUString>':'const std::less<rtl::OUString>' lvalue > `-CXXDefaultArgExpr 0xdaca4b8 <<invalid sloc>> 'const allocator_type':'const std::allocator<std::pair<const rtl::OUString, int>>' lvalue Clang AST.) Change-Id: I496fe9d4d5e1a033cb7b27b4e04b303f8ddbed4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157756 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-10-07loplugin:ostr: Rewrite some uses of O[U]String to use ""_ostr/u""_ustr literalsStephan Bergmann
This is a first cut at rewriting uses of OUString constructed from u"..." as u"..."_ustr. It covers the same changes as <https://gerrit.libreoffice.org/c/core/+/155412/6/> "WIP: Delete OUString UTF-16 string literal ctor/assignment op", but does so with automatic rewriting (see e0c33ec15f53a01fa3ee07489871bbe09bb5c9c3 "loplugin:ostr: automatic rewrite", plus a handful of 002b0a9d5793e07609f953b9961b04bcab7a7e3f "loplugin:ostr: manual modifications" where automatic rewriting wasn't set up to handle macro bodies). The compilation-time impact of all those changes appears to be negligible: For some Windows build of mine, just touching the files that would be affected by 002b0a9d5793e07609f953b9961b04bcab7a7e3f and e0c33ec15f53a01fa3ee07489871bbe09bb5c9c3 (but without actually applying those changes yet) and doing `time /opt/lo/bin/make -O check screenshot PKGFORMAT= gb_SUPPRESS_TESTS=x`, three times in a row reported sample real times of 21m15.438s 23m17.840s 23m41.529s and repeating all that with the two changes actually applied reported sample real times of 22m43.547s 21m42.687s 23m1.813s The plugin itself is already prepared to do further rewrites (see the TODOs), which will be done in follow-up commits. Change-Id: I408ecf056dce1b9da683d7c377b8d9058df1558d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157676 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-09-15loplugin, merge weakobject into weakbaseNoel Grandin
and make them support virtual bases, even though the bridge code does not support that (yet) Change-Id: I247e795391fa452dea2922869b15ab043eb2bdd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156941 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-28Adapt loplugin:unnecessaryparen to user-defined string literalsStephan Bergmann
Change-Id: Ieab59fa456bce13145b61cb5e8b2fb9ff9b4c573 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156193 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-08-28new loplugin:optionalboolNoel Grandin
which warns against using the 'operator bool' conversion of std::optional<bool> which can lead to interesting bugs The bugs that this plugin have been submitted independantly, so this change is just using has_value() in relevant places. Change-Id: I259b837feeecddcb8cd1d7e5db1e85bf505907cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155978 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-19loplugin: new global analysis locking2Noel Grandin
look for methods where we don't need to guard access to the field, because the field is never modified Change-Id: I62c33cc3f52881557515765d3733c4afc78547aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155836 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-08loplugin:unnecessarygetstr fix false +Noel Grandin
encountering when we need to pass a std::string to an OString Change-Id: I91d2aa1f20e7c2407c708c9ce4ae82fb52934c85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152526 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-08-04Avoid "function 'testDynamicCast()::S1::~S1' has internal linkage...Stephan Bergmann
...but is not defined" Change-Id: Ib1350d5d34eef0d544ca8f436ae63c693b7d2f5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155354 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-07-31loplugin:stringconstant: Catch some O[U]String::getStr anti-patternsStephan Bergmann
Change-Id: I36bc86fcffc3c10fe44e60d779c9aa48eeed00f2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154749 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-07-21loplugin:redundantcast small improvementNoel Grandin
Change-Id: I2c96b367138b94d6178a3c4a0f83049f13a04f82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154679 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-29loplugin:unusedfields make it a little smarterNoel Grandin
around dealing with operator[] on map data-types Change-Id: Idd6654948ae2d03d634fcf30a8d98530a78ab4ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153740 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-27loplugin:stringstatic look for more stringsNoel Grandin
that can be initialised at compile-time instead of runtime Change-Id: I08d516fdc13a3a79f93c079f89ac44cbc7a1ed71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153620 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-26new loplugin:constexprliteralNoel Grandin
OUStringLiteral should be declared constexpr, to enforce that it is initialised at compile-time and not runtime. This seems to make a different at least on Visual Studio Change-Id: I1698f5fa22ddb480347c2f4d444530c2e0e88d92 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153499 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-06-06add unit test for loplugin:staticmethodsNoel Grandin
Change-Id: Ied72c83dbc364f96e5b78a3cb915b23a1751ac0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152646 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-06update loplugin:stringview* for o3tl::iterateCodePointsNoel Grandin
And change o3tl::iterateCodePoints to use sal_Int32 for its second param, to integrate better with places where the parameter comes from an UNO API, which cannot use std::size_t Change-Id: I7b9dd2c9bc7f48e6c4a912f039f1b5dae7beae69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151421 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-05-04Adapt loplugin:randedforcopy to libc++ std::vector<bool>Stephan Bergmann
Seen unhelpful > sc/source/core/data/dpoutput.cxx:882:10: error: Loop variable passed by value, pass by reference instead, e.g. 'const const reference&' [loplugin:rangedforcopy] > for (const auto bCompact: aRowCompactFlags) > ^~~~~~~~~~~~~~~~~~~~ on macOS Change-Id: I9854e2498950951efc640bf31741229631e00e87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151393 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-04-24loplugin:unnecessarygetstr extend to more std::string checkingNoel Grandin
suggested by mike kaganski Change-Id: I5f5f254142767aca45a6101abdd84a0163ca6a34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150936 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-24loplugin:unnecessarygetstr extend to createFromAsciiNoel Grandin
idea from mike kaganski Change-Id: I0ecb9cad091d7a048d2ddae73165bf22748f3872 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-21loplugin:unnecessarygetstr extend to checking std::string::c_strNoel Grandin
Change-Id: I17398e2a6a31a2c98ba8e54b5c8045f22aee8759 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150749 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-17loplugin:stringadd: Adapt O[U]StringBuffer ctor detection for WindowsStephan Bergmann
...where sal_Int32 is not int, so a literal argument like 16 actually calls the O[U]StringBuffer(T length, std::enable_if_t<std::is_integral_v<T>, int> = 0) overload Change-Id: I1d151efbc723cbfa76690e02491b05a9a4147e91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150473 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-04-17Adapt expected diagnostics to WindowsStephan Bergmann
...where std::size_t is unsigned long long Change-Id: Icfe3927deaf4ffe57ac218ec109864852913cf31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150474 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-04-11loplugin:unnecessarygetstr check for OUString::number facilitiesNoel Grandin
These were fixed by mike kaganski, but add to the plugin to prevent future mistakes Change-Id: I09b4b094a74e02399e017ccf5631c0d68052344a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150215 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-09new loplugin:unnecessarygetstrNoel Grandin
which prevents constructing unnecessary temporaries via getStr() Change-Id: I9ca70893a10e954b5ee0e6ad6098660ee24c2bef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150170 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-06loplugin:stringadd also check O[U]StringBuffersNoel Grandin
For similar code sequences that can be improved. Also move containsComment from collapseif plugin code to plugin.cxx so we can use it from stringadd. Change-Id: Ie07d9aedf2c31cb0b2080e1b8584294d7046a8e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149217 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-04-05Adapt expected test output to recent ClangStephan Bergmann
...after 90c590812eecb3a0eb2748a132e304fa6c0ea0ad "Simplify O(U)String::number implementation" Change-Id: I3f5d7b1ff41a6d55293f15f15fd67bd5d2e69d69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150045 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-04-05Simplify O(U)String::number implementationMike Kaganski
Change-Id: I059f0324597a90aee01c95170a48ac5578f3caee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150037 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2023-03-23loplugin:stringview: Constructing O[U]String from O[U]StringLiteral is cheapStephan Bergmann
...so don't warn about those, as requested in the comment at <https://gerrit.libreoffice.org/c/core/+/149254/8#message-6430dc5397ab7b60bf4e78e6856b44ab6cd72c97> "tdf#154319: fix TOC field codes parsing" Change-Id: I25989cd4b42bc3fe9062a8a0d6896d32a18635d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149417 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-17loplugin:rangedforcopy: Assume non-reference structured binding is intentionalStephan Bergmann
See pending <https://gerrit.libreoffice.org/c/core/+/149026> "tdf#148008: do not proceed after the marked range" for a use case. Change-Id: Ief7cbb215068b6f5428c16a72896ef5612204128 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149056 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-17Avoid loplugin:unusedmember crash for templated offsetofStephan Bergmann
Change-Id: I6cbac308d2911a502381067398d72136ca2b5ae3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149045 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-10improve loplugin:unnecessarylockingNoel Grandin
to find more locking we can remove Change-Id: Ief7bc5ec2a1ff31f22a0ad366910b7fcc4725818 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148599 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2023-03-06The mentioned bug is fixed in Clang 17 trunk nowStephan Bergmann
Change-Id: Idb62b1b71a9f6fefc9225706655ca016304f1c42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148191 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-03-02Record loplugin:unreffun false positive caused by a Clang bugStephan Bergmann
(see the comments at <https://gerrit.libreoffice.org/c/core/+/146634/7#message-5164bcbdb4efa4711f001ce05b670b592392d853> "test: Use css::awt::XExtentdedToolkit::addTopWindowListener()" for how this caused an issue in the wild) Change-Id: Id5ec77885db45d039aedc7e13d714aaa96572e91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148076 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-28Remove compilerplugins/clang/test/cppunitassertequals.hxxStephan Bergmann
...which isn't needed anymore to suppress warnings from other plugins like loplugin:external ever since 45c06838e95c94445359536d84c6328fa8b17a66 "only unit-test one loplugin at a time". Also, the declaration of the function test in cppunitassertequals.hxx had already started to deviate from its definition in cppunitassertequals.cxx. Change-Id: I3fbc8a9a805bd5bc4d8afbf958edff04b89add3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148010 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2023-02-28Extend loplugin:cppunitassertequals to CPPUNIT_ASSERT_LESS etc.Stephan Bergmann
(Just in case, even though this doesn't find any actual issues in the code for now.) Change-Id: I80b8b0a647e89fdb6a4f0f4363fa1c3df8e5ddeb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147942 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>