orbitcowboy
cf6d30f358
Merge branch 'main' of https://github.com/danmar/cppcheck into main
2022-01-25 13:08:25 +01:00
orbitcowboy
00997283cb
Code formatting
2022-01-25 13:08:05 +01:00
chrchr-github
f49cfcd23c
Fix #10200 False positive: uninitStructMember ( #3741 )
2022-01-25 12:14:20 +01:00
chrchr-github
ea81ce933e
Fix #10754 FP invalidFunctionArg with resize() ( #3737 )
2022-01-25 12:13:49 +01:00
chrchr-github
d05e43ce15
Fix #9828 False positive: unreadVariable alias ( #3744 )
2022-01-24 21:52:45 +01:00
chrchr-github
9d6e5c2a05
Fix #10237 uninitMemberVar - member initialized via function call ( #3745 )
2022-01-24 21:52:00 +01:00
chrchr-github
158f3d494e
Fix #10143 false positive: redundantInitialization with std::shared_ptr ( #3746 )
2022-01-24 21:50:50 +01:00
chrchr-github
d64dadcd31
Fix #10758 Crash in CheckClass::checkConstFunc() ( #3740 )
2022-01-24 21:50:01 +01:00
chrchr-github
b491fcc489
Add test cases for #9850 , #9910 ( #3747 )
2022-01-24 15:06:40 +01:00
Paul Fultz II
01e14a12f1
Fix 10755: Assertion "!maxValue->isKnown()" from valueFlowInferCondition ( #3739 )
...
* Fix 10755: Assertion "!maxValue->isKnown()" from valueFlowInferCondition
* Format
2022-01-22 12:25:20 +01:00
Paul Fultz II
8b1ed9cbe1
Another fix for 10739: internalAstError with decltype ( #3738 )
...
* Another fix for 10739: internalAstError with decltype
* Format
2022-01-22 07:22:57 +01:00
chrchr-github
b23ca879ed
Fix #10735 FP functionConst with overloaded operator[] [inconclusive] ( #3733 )
2022-01-21 20:40:10 +01:00
Paul Fultz II
a7dbd288c4
Fix 10738: FP knownEmptyContainer with auto reference ( #3734 )
...
* Fix 10738: FP knownEmptyContainer with auto reference
* Format
2022-01-21 09:56:55 +01:00
Paul Fultz II
6c2b1f093d
Another fix for 10728: Crash in CheckStl::checkDereferenceInvalidIterator2() ( #3735 )
...
* Another fix for 10728: Crash in CheckStl::checkDereferenceInvalidIterator2()
* Format
2022-01-21 09:56:41 +01:00
Paul Fultz II
0737cc4d8c
Fix 10708: Assertion "!maxValue->isKnown()" from valueFlowInferCondition ( #3736 )
...
* Fix 10708: Assertion "!maxValue->isKnown()" from valueFlowInferCondition
* Format
2022-01-21 09:56:24 +01:00
Paul Fultz II
57b50e4b00
Fix 10739: internalAstError with decltype ( #3723 )
2022-01-20 21:36:48 +01:00
chrchr-github
7f9ef8c321
Add test cases for #7899 , #7974 , #9256 ( #3726 )
...
* Add test case for #7899 and #7974
* Add test case for ##9256
2022-01-20 16:15:38 +01:00
chrchr-github
4d44d0c079
Fix #9781 FP deallocuse after auto_ptr ( #3724 )
2022-01-19 21:39:45 +01:00
chrchr-github
089ca67d78
Use TODO_ASSERT ( #3704 )
2022-01-18 22:03:52 +01:00
Oliver Stöneberg
55ff684f34
added unusedFunction self check to CI / cleanups ( #3526 )
2022-01-18 22:02:25 +01:00
Rikard Falkeborn
e106654993
Fix #10729 : Uncaughty exception in CheckMemoryLeak::getReallocationType() ( #3717 )
2022-01-18 20:50:06 +01:00
chrchr-github
1e2863cd33
Fix #10520 FP functionConst with aggregate initialization [inconclusive] ( #3720 )
2022-01-18 20:49:35 +01:00
chrchr-github
ca2e0ca287
Fix FP functionConst with extra parentheses ( #3722 )
2022-01-18 20:21:25 +01:00
chrchr-github
cb5a50c6a7
Fix #10710 FN passedByValue with QString ( #3696 )
2022-01-18 20:17:05 +01:00
Paul Fultz II
7b793af451
Fix 10728: Crash in CheckStl::checkDereferenceInvalidIterator2 ( #3721 )
...
* Fix 10728: Crash in CheckStl::checkDereferenceInvalidIterator2
* Format
2022-01-18 14:48:02 +01:00
orbitcowboy
b6c010c17e
Added regression test for Ticket 7981.
2022-01-18 13:09:02 +01:00
chrchr-github
c2fc4973ad
Fix #10515 False positive for explicit one-argument constructor if co… ( #3718 )
2022-01-17 20:51:23 +01:00
chrchr-github
9c56e7ea8d
Fix #6475 FN uninitialized variable usage not detected ( #3700 )
2022-01-17 20:35:30 +01:00
chrchr-github
605fd7cf98
Fix #10146 FP functionConst (inconclusive) with nested members ( #3719 )
2022-01-17 20:33:32 +01:00
Paul Fultz II
7406dd8c94
Fix 10721: Crash in Tokenizer::simplifyTokenList1 ( #3712 )
2022-01-16 12:46:20 +01:00
Paul Fultz II
abb0563cef
Fix 10726: Crash in CheckExceptionSafety::checkRethrowCopy ( #3711 )
2022-01-16 12:35:51 +01:00
Paul Fultz II
89bc226738
Fix 10718: Crash in CheckOther::checkDuplicateExpression ( #3713 )
2022-01-16 12:34:20 +01:00
Paul Fultz II
4af98f21d6
Fix 10588: crash ( #3691 )
2022-01-16 12:33:31 +01:00
Paul Fultz II
9220c8175d
Remove todo assert ( #3714 )
2022-01-16 12:32:46 +01:00
Paul Fultz II
55ff010df3
Fix 10717: Crash in SymbolDatabase::setValueTypeInTokenList ( #3710 )
...
* Fix 10717: Crash in SymbolDatabase::setValueTypeInTokenList
* Format
2022-01-15 07:56:56 +01:00
Paul Fultz II
0b1cd8626d
Fix 10664: Crash in Token::linkAt ( #3708 )
...
* Fix 10664: Crash in Token::linkAt
* Format
2022-01-14 23:51:01 +01:00
Paul Fultz II
2b6a89e30e
Fix 10716: Crash in CheckStl::checkDereferenceInvalidIterator2 ( #3709 )
...
* Fix 10716: Crash in CheckStl::checkDereferenceInvalidIterator2
* Format
2022-01-14 23:50:33 +01:00
chrchr-github
781a145680
Fix regression: functionStatic related to overload resolution ( #3705 )
2022-01-14 17:55:50 +01:00
chrchr-github
12abf85d1d
Add test case for #5777 , use TODO_ASSERT, enable test case ( #3703 )
...
* Add test case for #5777 , use TODO_ASSERT, enable test case
* Comment
2022-01-13 19:52:02 +01:00
Armin Müller
5a05631c84
Typos found by running "codespell" ( #3702 )
2022-01-13 17:24:26 +01:00
chrchr-github
95dc05b21d
Fix #7732 false negative: (style) Unused variable: std::pair ( #3695 )
2022-01-13 08:05:05 +01:00
chrchr-github
af0a585a70
Partial fix for #9157 False negative: stlOutOfBounds, cast ( #3699 )
2022-01-13 08:03:24 +01:00
Maurice Gilden
44b182c9a7
Improve definitions for googletest ASSERT_* macros ( #3694 )
...
This avoids assertWithSideEffect and follows more closely what the real macros
are doing, similar to the ones in boost.cfg and cppunit.cfg.
2022-01-12 22:09:17 +01:00
chrchr-github
7aa0ec3e95
Fix regression: unreadVariable for trivial initialization ( #3698 )
2022-01-12 22:06:03 +01:00
chrchr-github
1b89c998f5
Fix #10469 FP returnTempReference with overloaded operator+= ( #3678 )
2022-01-12 22:05:30 +01:00
Paul Fultz II
fa651272f0
Fix 10001: Syntax error on valid C++ code ( #3697 )
2022-01-12 22:04:28 +01:00
chrchr-github
e4c8798974
Fix #10556 FP containerOutOfBounds with QList [inconclusive] ( #3688 )
2022-01-12 22:03:57 +01:00
chrchr-github
1670805a8d
Fix #10490 FP unreadVariable with std::shared_lock ( #3672 )
2022-01-10 07:43:02 +01:00
chrchr-github
df3da38483
Fix #10682 Unused QString / #10686 unused std::array / #10005 unused variable with c++11 braced initializer not detected ( #3684 )
2022-01-10 07:36:49 +01:00
Paul Fultz II
4ef20f8f1e
Fix 10683: FP danglingTemporaryLifetime with pointer to vector ( #3685 )
2022-01-10 07:34:26 +01:00
Paul Fultz II
fe7595cd9d
Fix 10677: crash during valueFlowInferCondition ( #3687 )
2022-01-09 22:43:08 +01:00
orbitcowboy
4a3a287248
Improved test case for ticket 1586
2022-01-08 18:39:19 +01:00
orbitcowboy
89e60af516
Ticket #1586 - Added regression test
2022-01-08 17:45:45 +01:00
Paul Fultz II
0c9eb5d190
Fix 10681: FP ctuuninitvar with array member ( #3686 )
2022-01-08 10:47:28 +01:00
chrchr-github
635c09643d
Add tests for #8498 , #9887 ( #3680 )
2022-01-07 12:34:57 +01:00
shaneasd
8f7996211b
remove nullScope from TestSymbolDatabase ( #3679 )
2022-01-06 15:23:43 +01:00
chrchr-github
9fda86eb6d
Fix #9998 ( #3676 )
2022-01-06 15:21:05 +01:00
chrchr-github
6c55f9cf88
Add test for #10133 ( #3675 )
2022-01-06 15:19:10 +01:00
Paul Fultz II
1682344a80
Fix 10678: FP nullPointerArithmeticRedundantCheck in while loop ( #3674 )
2022-01-04 21:19:45 +01:00
chrchr-github
fe077fc141
Add test for #10312 ( #3673 )
2022-01-04 20:50:00 +01:00
Oliver Stöneberg
0ba9cb4e64
fixed some unusedFunction warnings ( #3618 )
2022-01-04 15:48:08 +01:00
chrchr-github
c05e2cc6c4
Fix #10154 False positive: objectIndex ( #3666 )
2022-01-04 10:37:16 +01:00
Paul Fultz II
119ec0582a
Fix 10676: FP: Array index -1 is out of bounds. ( #3670 )
2022-01-04 10:21:54 +01:00
Daniel Marjamäki
3524a0a3eb
exprengine: reduce max buffer size to int_max
2022-01-03 20:55:46 +01:00
Daniel Marjamäki
33305ef4ec
exprengine: better checking for uninit variables
2022-01-03 12:47:13 +01:00
Oliver Stöneberg
6739995e79
removed or annotated some code which is only used in test code ( #3656 )
2022-01-03 12:40:20 +01:00
Paul Fultz II
01a8890d6d
Fix 9760: False positive: constParameter on parameter used to take non-const pointer via array decaying ( #3660 )
2022-01-02 08:15:38 +01:00
Paul Fultz II
71a44395c8
Fix 10659: FP knownConditionTrueFalse - C++17 structured binding ( #3662 )
2022-01-02 08:14:50 +01:00
KenPatrickLehrmann
af289c8357
Handle (&foo)-> in isVariableChanged ( #3624 )
2022-01-02 08:14:10 +01:00
Armin Müller
d5daba331f
Typos found by running "codespell" ( #3659 )
2022-01-02 08:12:08 +01:00
Paul Fultz II
50862d1ace
Fix 10665: Crash in ExpressionAnalyzer ( #3661 )
2022-01-02 08:09:23 +01:00
Paul Fultz II
4b04c86249
Add regression for 9917: false positive: bitwiseOnBoolean when lhs is non-boolean ( #3664 )
2022-01-02 08:08:28 +01:00
Paul Fultz II
0c952ca05d
Fix 10223: ValueFlow; known value for a volatile variable ( #3658 )
2022-01-01 23:15:14 +01:00
Paul Fultz II
7bf0ca8d00
Fix 10672: crash: CheckAutoVariables ( #3657 )
2022-01-01 00:14:36 +01:00
chrchr-github
922e27de4c
Fix #7754 FP Same expression on both sides of '||' ( #3635 )
2021-12-31 08:24:05 +01:00
Rikard Falkeborn
8537331ad6
AutovarDeallocation: Fix grammar in error message ( #3654 )
2021-12-23 20:09:55 +01:00
Paul Fultz II
d36aa590cd
Fix 10553: FP uninitvar with strcpy ( #3652 )
2021-12-23 08:22:41 +01:00
Daniel Marjamäki
e6ccf299b9
Fixed #10598 (SymbolDatabase: final class is not parsed properly)
2021-12-22 21:48:01 +01:00
Chris Lalancette
df1d6cf026
Fix the ability to recognize return types when simplifying attributes. ( #3637 )
...
* Fix the ability to recognize return types when simplifying attributes.
When parsing attributes to remove them, we have to allow for
the case where the return type of the function that follows
the attribute has a namespaced C++ type, like foo::bar .
That means that :: has to be recognized as a valid token.
Fix this in simplifyAttribute, and add tests for this as well.
2021-12-22 19:02:38 +01:00
chrchr-github
5a95ece15e
#10591 : add TODO ( #3647 )
2021-12-21 10:24:38 +01:00
chrchr-github
ca4e5ac527
Fix #7038 false negative for string argument in the CheckIO ( #3649 )
2021-12-20 17:22:39 +01:00
chrchr-github
e6091cbe54
Add tests for #4647 , #5979 , #8763 , #10101 ( #3648 )
2021-12-20 13:12:19 +01:00
Paul Fultz II
73f24b43f9
Fix 10437: FP knownConditionTrueFalse after pointer check ( #3646 )
2021-12-20 07:28:40 +01:00
orbitcowboy
b2d81f0870
Ticket #8640 : Added regression test
2021-12-19 17:43:32 +01:00
Paul Fultz II
d69257e8cd
Fix 9740: FP accessMoved related to designated initialization ( #3644 )
2021-12-19 12:36:48 +01:00
Oliver Stöneberg
cc24d6fcef
Fix #9162 (Invalid --project files do not give any error) ( #3177 )
2021-12-19 12:36:11 +01:00
chrchr-github
bb327be8e8
Fix #10591 FP unusedStructMember with value-initialized struct and typedef ( #3643 )
2021-12-18 22:55:52 +01:00
chrchr-github
8df25ec4e9
Fix #8266 identicalConditionAfterEarlyExit variable modified in if-clause ( #3610 )
2021-12-18 22:52:54 +01:00
Paul Fultz II
332f4c205a
Fix 9772: FP uninitvar: in cppcheck 2.1 ( #3638 )
2021-12-17 21:51:47 +01:00
Paul Fultz II
e7db974606
Fix 10621: FP arrayIndexOutOfBoundsCond with multiple index checks ( #3640 )
2021-12-17 21:48:29 +01:00
Paul Fultz II
4fb43a3f56
Fix 10643: FP: (error) Array 'buf[64]' accessed at index -1, which is out of bounds. ( #3639 )
...
* Fix 10643: FP: (error) Array 'buf[64]' accessed at index -1, which is out of bounds.
* Format
2021-12-17 10:05:57 +01:00
Paul Fultz II
398fa28021
Fix 10657: False positive; ValueFlow - invalid iterator ( #3636 )
2021-12-16 22:34:51 +01:00
Paul Fultz II
ac4f4258a0
Fix 10651: Crash on static template method ( #3633 )
2021-12-16 22:32:44 +01:00
Oliver Stöneberg
ba402f3e50
cleaned up includes based on include-what-you-use ( #3627 )
2021-12-15 19:47:27 +01:00
Paul Fultz II
5414814238
Fix 10649: False positive: wrong known value after reassignment ( #3631 )
2021-12-15 19:37:25 +01:00
Paul Fultz II
16110b6157
Fix 10339: Lambda in leads to analysis fail ( #3629 )
2021-12-15 19:34:18 +01:00
Paul Fultz II
5f73af0d0e
Fix 10625: False positive: known value below do while ( #3623 )
2021-12-15 19:32:14 +01:00
Paul Fultz II
6681576707
Fix 10642: False positive: Possible dereference of an invalid iterator: v.begin()+v.size()-1 ( #3630 )
2021-12-15 19:31:28 +01:00
chrchr-github
532477cdb2
Fix #9549 FP knownConditionTrueFalse (bitshift) ( #3616 )
2021-12-14 07:30:57 +01:00
Paul Fultz II
cb2738a60c
Fix 10645: FP knownEmptyContainer after conditional return ( #3620 )
2021-12-14 07:22:57 +01:00