Stephan Bergmann
306ddfb1b8
Replace deprecated std::mem_fun et al in reportdesign
...
(as std::mem_fun is gone by default at least from recent libc++ in C++17 mode)
Change-Id: Ib66134bd4072dfe0ce3bc36aa684cee710921235
Reviewed-on: https://gerrit.libreoffice.org/45868
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-12-05 18:11:15 +01:00
Stephan Bergmann
b35bb38f18
Clean away temporarily added using declarations
...
Change-Id: I26734c13515394162d88351a1cbe2b20abdac865
2017-11-07 11:50:47 +01:00
Stephan Bergmann
5807952ef7
loplugin:redundantcast: Do warn about convoluted dynamic_cast to self
...
...that the compiler is free to elide anyway. (See
4e7ffc0a69dac31ca7e0f1649f1697a1ff8d6e5f "Avoid compiler eliding#redundant
dynamic_cast" and 380d6afe5fd691f6ad4b17fc38b79b9fca4ba906 "Remove redundant
asserts involving dynamic_cast".)
Change-Id: I3f75154fee3e978b7ba95a5a27589417065599bd
2017-10-22 11:57:44 +02:00
Noel Grandin
ead920a48a
loplugin:redundantcast handle dynamic_cast
...
Change-Id: I7855c76e820efce96778b1c19ec71dffcc4b4abb
Reviewed-on: https://gerrit.libreoffice.org/43621
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-10-21 15:44:11 +02:00
Stephan Bergmann
d883e3556a
loplugin:redundantcast: cstyle_cast within reinterpret_cast
...
Change-Id: Ie31c9dd6d8741aa856553b798bb5b7f695a3fe0f
Reviewed-on: https://gerrit.libreoffice.org/42776
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Tested-by: Stephan Bergmann <sbergman@redhat.com>
2017-09-26 10:01:54 +02:00
Stephan Bergmann
7282b25f22
Fix loplugin:redundantcast's VisitCXXFunctionalCastExpr
...
...when t1 is ElaboratedType sugar (which isn't only used when the type is
written with an elaborated type keyword, but also when it is written with a
qualified name).
(I originally wrote testArithmeticTypedefs to track down a different issue,
which turned out to be a non-issue, with this fix as fall-out. So that test
doesn't quite match the theme of this commit, but is a worthwhile addition
nonetheless.)
Change-Id: Ic447da4399853d7d045e3e2e7ade8ddf52d89749
2017-09-15 18:50:45 +02:00
Noel Grandin
5685ee25aa
improve redundantcast loplugin
...
to find c-style casts where the expression is a templated method
Change-Id: Ifbd1e2cdc72d906fc95a7ec0f9408c3f6d2a836b
Reviewed-on: https://gerrit.libreoffice.org/42275
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-09-14 14:43:43 +02:00
Stephan Bergmann
c5616014bb
loplugin:redundantcast: suppress warnings in reworked glibc assert macro
...
Change-Id: I20be230b3ff5d11395f33a9896d0a575c3051fb7
2017-08-25 20:21:25 +02:00
Stephan Bergmann
d7a9abdce5
Report full type info (plus the desugared type as "aka")
...
Change-Id: I647b1c3e479e0be01ed7ea16e1ad3dd9bed9ba6a
2017-08-18 10:23:42 +02:00
Noel Grandin
3281628e1c
loplugin:redundantcast ignore functional casts involving typedefs
...
<sberg> noelgrandin, 718cdd43c25783d9cd402e381123efe3981cc514 now also
looks through typedef sugar, e.g. complaining about a gdouble -> double
expl. conversion in configmgr/source/dconf.cxx;
I think we want to remain silent about such conversions involving typedefs
<noelgrandin> sberg, ah, good point.
Change-Id: Icbb0d6be273f53e507c91556cf0ccb5a5c03e5a1
Reviewed-on: https://gerrit.libreoffice.org/41175
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-15 15:45:34 +02:00
Noel Grandin
718cdd43c2
loplugin:redundantcast, find more functional casts
...
In the enum types that caused the problem look like this when I dump
then:
EnumType 0xdb45770 'enum SvxFrameDirection'
`-Enum 0xdb456d8 'SvxFrameDirection'
SubstTemplateTypeParmType 0xdb61200 'enum SvxFrameDirection' sugar
|-TemplateTypeParmType 0xd7518f0 'EnumT' dependent depth 0 index 0
| `-TemplateTypeParm 0xd7518a8 'EnumT'
`-EnumType 0xdb45770 'enum SvxFrameDirection'
`-Enum 0xdb456d8 'SvxFrameDirection'
Change-Id: Id8fedabe43b7a27df61a2320a9acbf54d2dc7882
Reviewed-on: https://gerrit.libreoffice.org/41169
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-08-15 13:46:29 +02:00
Stephan Bergmann
0f84a32f5b
Improved loplugin:redundantcast, const/static_cast combinations
...
Change-Id: I3b24327835cd4e1842ee6e9b87ab06efa25a4bbf
2017-06-05 21:17:59 +02:00
Stephan Bergmann
0763d8413e
Reduce loplugin:redundantcast warnings about functional casts even futher
...
Change-Id: I8884e17c453831e048c43012ee176093c5b2f99e
2017-06-05 21:17:55 +02:00
Andrea Gelmini
ac341548dc
Fix typos
...
Change-Id: I9eb05432732a04e816946fbb13001df100a31f73
Reviewed-on: https://gerrit.libreoffice.org/38395
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-06-05 17:58:20 +02:00
Stephan Bergmann
c855400e96
Reduce loplugin:redundantcast warnings about functional casts even futher
...
Change-Id: Ieae9b5c9c7c6d9b8459e5d163f55d8f5024adfae
2017-06-02 14:00:08 +02:00
Stephan Bergmann
95645cbf0a
Improved loplugin:redundantcast const_cast handling
...
Change-Id: I4c24ff5d9d5e74bef2a4040c6308c504282af55d
2017-06-02 13:31:37 +02:00
Stephan Bergmann
1fce984051
Make loplugin:redundantcast functional cast warnings more verbose
...
(useful when types involve typedefs)
Change-Id: I93e8962fd4b9c4ef79990e057dfa07538380008c
2017-06-02 10:35:05 +02:00
Stephan Bergmann
beae2dd6c8
Improved loplugin:redundantcast static_cast handling
...
Change-Id: I74e4ebda40f95661c5ae344132fcabbbf08ab0a4
2017-06-02 09:38:15 +02:00
Stephan Bergmann
93aeaa75a4
Improve suppression of loplugin:redundantcast in CPPUNIT_ASSERT
...
Change-Id: I65f95e7245f08592ea11cc75e1cf34dcbdf16b40
2017-06-01 14:37:02 +02:00
Stephan Bergmann
bef247d137
DataRecursionQueue was only introduced in Clang 3.8
...
(r253948 "Use data recursion in RecursiveASTVisitor when traversing Stmt and
Expr nodes")
Change-Id: I393474048ecbe0f6b7f19f00c2f830f495b2b6f0
2017-05-31 09:18:08 +02:00
Stephan Bergmann
7d858ad057
Restrict loplugin:redundantcast to "real" casts
...
Change-Id: Ifc9de898e5c9a084cbfd739625c679185c3a1534
2017-05-30 15:46:55 +02:00
Stephan Bergmann
3dda91dda8
Traverse InitListExpr only once
...
Arbitrarily chosing to traverse the semantic instead of the syntactic form.
Change-Id: Id1b4e49421a5550bb2fa9f0d7e6f83bf7abb6ebb
2017-05-30 14:39:23 +02:00
Stephan Bergmann
f6dda4e160
Make loplugin:redundantcast accept bool(FD_ISSET(...)) again
...
Change-Id: I4e96c55c246cf806f17df31844a00d0e8a5e4f56
2017-05-30 13:40:53 +02:00
Noel Grandin
2ccde70d60
teach redundantcast plugin about functional casts
...
Change-Id: Iac8ccd17d9e46ebb2cb55db7adb06c469bbd4ea0
Reviewed-on: https://gerrit.libreoffice.org/37910
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-05-30 08:50:31 +02:00
Stephan Bergmann
8b1fcedcd1
...and re-eanble loplugin:stringcopy again
...
<http://reviews.llvm.org/D22128 > "Make CastExpr::getSubExprAsWritten look
through implicit temporary under CK_ConstructorConversion" was biting me again.
(I had originally developed loplugin:stringcopy against a Clang build that
includes my local fix for that issue. I really need to see to get that resolved
upstream...)
(And while 957874168491f4b030fda85c65dd969aae82a670 "loplugin:stringcopy" was
actually a false positive, it doesn't hurt either, so just keep it.)
Change-Id: I726956adfbe67681005173cfdfed2e4b4cd6253d
2017-05-19 23:57:03 +02:00
Noel Grandin
f12096272e
spelling, implictly->implicitly
...
Change-Id: I2d733ed3ce9395d11700d739cbd6d123649b4013
2017-05-03 11:18:21 +02:00
Noel Grandin
be8b9b4d29
loplugin:redundantcast find cstyle arithmetic casts
...
Change-Id: If7c259f0d12a41182f476ddb558f7cb5f76f9577
Reviewed-on: https://gerrit.libreoffice.org/36253
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-07 12:16:13 +00:00
Noel Grandin
26e7c6d6ab
loplugin:redundantcast check for c-style char casts
...
Change-Id: Id6881262e370fd563ec29db95e4af5cfcb04ea34
Reviewed-on: https://gerrit.libreoffice.org/36247
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-07 07:07:40 +00:00
Stephan Bergmann
6b4a4bab6d
Improved loplugin:redundantcast, static_cast on arithmetic types
...
Change-Id: I6e1f76de4b1ebf76ad02e7d0cd1374b4def83932
2017-04-06 18:33:20 +02:00
Noel Grandin
6768a9b602
loplugin:redundantcast check for c-style casts to void
...
Change-Id: Ic8b99f590436f94825e471bc61411c69fd768862
Reviewed-on: https://gerrit.libreoffice.org/36208
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-06 13:03:06 +00:00
Noel Grandin
f1945405b0
loplugin:redundantcast check for c-style float casts
...
Change-Id: I86b6f58887cb398a80698f8d8564b5bc3f55eabb
Reviewed-on: https://gerrit.libreoffice.org/36198
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-06 11:41:46 +00:00
Noel Grandin
7662e92c64
loplugin:redundantcast find cstyle double casts
...
Change-Id: I5507be190dac781e5cdb545a60acf3d50056c9f8
Reviewed-on: https://gerrit.libreoffice.org/36187
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-06 07:47:30 +00:00
Noel Grandin
572e9cde74
loplugin:redundantcast find c-style bool casts
...
Change-Id: I3237b93babc67de12c3771aa84766c2141ca93b2
Reviewed-on: https://gerrit.libreoffice.org/36137
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-04-05 12:21:19 +00:00
Stephan Bergmann
3c7652203c
Teach loplugin:redundantcast about C-style casts in macro bodies
...
Change-Id: Ic1fbc8dd16c4d78772fc11a9c2ce09f056e36c79
Reviewed-on: https://gerrit.libreoffice.org/35680
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2017-03-25 12:51:54 +00:00
Noel Grandin
ed76d1d350
loplugins:redundantcast teach it about c-style typedef casts
...
Change-Id: I1ac11a2481c0f4d8be1e1fd7c7637ac0ece3d65c
Reviewed-on: https://gerrit.libreoffice.org/35558
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-23 09:48:10 +00:00
Noel Grandin
7299481834
loplugin:redundantcast find redundant c-style enum casts
...
Change-Id: I2dab376d87804521aed6b6bd41ad7762830fa349
Reviewed-on: https://gerrit.libreoffice.org/35467
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-03-22 06:47:35 +00:00
Stephan Bergmann
be06700309
Silence loplugin:redundantcast false warning
...
...that is curiously only reported when building with clang -std=gnu++17:
> sc/qa/unit/ucalc_condformat.cxx:185:80: error: redundant const_cast from 'ScConditionalFormat *' to 'const ScConditionalFormat *', result is implictly cast to 'const ScConditionalFormat *const' [loplugin:redundantcast]
> CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong conditional format instance.", pCheck, const_cast<const ScConditionalFormat*>(pFormat));
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> workdir/UnpackedTarball/cppunit/include/cppunit/TestAssert.h:230:32: note: expanded from macro 'CPPUNIT_ASSERT_EQUAL_MESSAGE'
> (actual), \
> ~^~~~~~~
> 1 error generated.
> make[1]: *** [solenv/gbuild/LinkTarget.mk:270: workdir/CxxObject/sc/qa/unit/ucalc_condformat.o] Error 1
Change-Id: If2e8577bad4ec7454d584eb59106734d47f876ad
2017-02-16 17:56:08 +01:00
Stephan Bergmann
440720e14d
loplugin:redundantcast: Avoid double warnings on some const_cast
...
Change-Id: I1e6140fef55054899dd32465726e804fc6006394
2017-02-16 17:43:23 +01:00
Stephan Bergmann
0f22790e6b
Generalize typedef-to-void* check in loplugin:redundantcast
...
...to also cover cases like conversion betwen LPVOID and HANDLE in Windows-only
code
Change-Id: I934fe89372ee7a12462e7ad4284b9ea2cc73ce5a
2016-12-18 22:43:26 +01:00
Stephan Bergmann
9d80c032fe
loplugin:redundantcast: redundant static_casts
...
Change-Id: I4d50b77745d68a23136221ef06f327137e89fa7e
2016-07-08 16:47:31 +02:00
Stephan Bergmann
733198de1b
Remove support for Clang < 3.4
...
Change-Id: I81e97c5f720535b33dd3ce72d01151765e4e93a0
2016-06-29 09:15:25 +02:00
Stephan Bergmann
1ce7176ba1
Remove support for Clang < 3.3
...
Change-Id: I185852a738bac10dc6d331afccfcbc7ae1225cb1
2016-06-29 08:55:27 +02:00
Stephan Bergmann
779f06f9a8
Ambiguity between clang:: and llvm::PointerType
...
Change-Id: I2727ef17b9ab780c608878aaca9ce0fda01b9c22
2016-03-20 13:29:50 +01:00
Stephan Bergmann
0571f3c503
loplugin:redundantcast: const_cast to same type
...
Change-Id: I1abdc2ab0b145e12f7fb00db529f52c11e4d7cfd
2015-05-29 12:05:09 +02:00
Stephan Bergmann
0bfc98e63b
loplugin:redundantcast: reinterpret_cast to void*
...
Change-Id: I947b49cfb15f0e7d6ddfaae386656c70e4bd48ba
2015-05-12 18:27:54 +02:00
Stephan Bergmann
373a9b9bb6
loplugin:redundantcast: redundant const_cast followed by implicit upcast
...
Change-Id: I58297ba336d96358eb0683684bbd763870ef56cb
2015-04-13 12:36:36 +02:00
Stephan Bergmann
90ed482496
Reduce to static_cast any reinterpret_cast from void pointers
...
Change-Id: I514e183571e4ac109f59c4bdfccdc553c36c26ee
2015-03-31 13:18:16 +02:00
Stephan Bergmann
2688a88297
Remove leftover debug code
...
Change-Id: I874fc4d677abb2646bffb4331a220f3812443b66
2015-03-30 13:48:45 +02:00
Stephan Bergmann
13e45d6fde
loplugin:redundantcast: Don't warn about certain casts in macros
...
...that might depend on macro arguments and not really be redundant
Change-Id: If19de3835a4972add58965ea7c0936fad7ef6957
2015-03-28 19:09:17 +01:00
Stephan Bergmann
1c78277801
const_cast: convert some C-style casts and remove some redundant ones
...
Change-Id: I876736d18db6676629c283fccd65e1b6fb2bb2be
2015-03-26 15:33:41 +01:00