12788 Commits

Author SHA1 Message Date
Daniel Marjamäki
b5aaf8d577 Suppress false positive 2021-04-21 14:49:06 +02:00
Daniel Marjamäki
bfb98dbf51 TemplateSimplifier: updated output of uninstantiated c++17 fold expressions 2021-04-21 13:13:11 +02:00
Daniel Marjamäki
35c934c887 Fixed self-check warning 2021-04-20 16:46:05 +02:00
Daniel Marjamäki
04e9c13bc6 TemplateSimplifier; Better handling of c++17 fold expressions and c++20 concepts.
c++17 fold expressions are simplified to a __cppcheck_uninstantiated_fold__ if they are not instantiated.

c++20 concepts are skipped/removed by Cppcheck and these will be enforced by the compiler.
2021-04-20 15:40:25 +02:00
Paul Fultz II
db5f00a16a
Fix issue 10214: FP: danglingTempReference doesn't account for reference lifetime extension (#3220)
* Fix issue 10214: FP: danglingTempReference doesn't account for reference lifetime extension
2021-04-19 14:20:29 +02:00
IOBYTE
59f7b937f1
fix daca2 gdcm template simplifier crash (#3221)
This only fixes the crash. The templates that are instantiated are
correct but one template is left uninstantiated. Fixing the missing
instantiation is not easy and will be looked at later.

Co-authored-by: Robert Reif <reif@FX6840>
2021-04-19 09:17:49 +02:00
Paul Fultz II
c1bb1d771b
Fix issue 10012: False positive: mismatching container, not containers (#3222)
* Fix issue 10012: False positive: mismatching container, not containers
2021-04-19 09:17:02 +02:00
Paul Fultz II
691f681d86
Fix issue 10235: Regression: oppositeInnerCondition (#3223) 2021-04-19 09:15:03 +02:00
Oliver Stöneberg
5de58c4ddd
added clang-tidy to CI (#3218) 2021-04-18 21:51:47 +02:00
Paul Fultz II
563c9dd9cc
Fix issue 10208: FP: knownConditionTrueFalse in for loop with function that assigns by ref (#3198) 2021-04-18 21:42:27 +02:00
Daniel Marjamäki
56773b82c4 Simple handling of coroutines 2021-04-18 19:42:22 +02:00
Paul Fultz II
a772d652d8
Fix issue 9932: FP: containerOutOfBounds (#3217)
* Fix issue 9932: FP: containerOutOfBounds
2021-04-18 10:43:38 +02:00
Daniel Marjamäki
9a9043a07e Fixed #4349 (Support C++11 variadic templates) 2021-04-17 21:57:21 +02:00
Oliver Stöneberg
3bc71f982a
enabled "debug" findings in self-check / split "simplifyUsing" and "simplyTypedef" from more generic "debug" (#3210) 2021-04-17 18:07:47 +02:00
IOBYTE
5568ac95e7
fix simplifyUsing debug warning for: using value_type = const ValueFlow::Value; (#3211) 2021-04-17 14:20:16 +02:00
Oliver Stöneberg
155ff890a5
split "autoNoType" and "bailoutUninitVar" from more generic "debug" (#3209) 2021-04-16 15:19:29 +02:00
Daniel Marjamäki
11f828a669 Fixed #9415 (C++11: alignas not handled -> wrong code -> false negatives) 2021-04-15 20:26:53 +02:00
orbitcowboy
e869452240 #10244: Fixed false negative: bufferAccessOutOfBounds 2021-04-13 16:40:38 +02:00
Oliver Stöneberg
5a7e361442
run self-checks with standard set to C++11 (#3206) 2021-04-12 18:29:13 +02:00
Daniel Marjamäki
eacc9e552e Function::returnsReference: handle type scope better 2021-04-10 14:31:50 +02:00
Paul Fultz II
5cf2f7e633
Fix issue 10087: false positive: error: Reference to temporary returned. (#3205) 2021-04-09 07:44:20 +02:00
Paul Fultz II
255f273c46
Fix issue 10088: ValueFlow: Array size, wrong known value (#3204) 2021-04-09 07:43:54 +02:00
ericmalenfant
1e9687aa8b
Fix noCopyConstructor with multiple inheritance (#3203) 2021-04-09 07:41:59 +02:00
Paul Fultz II
f8dc9862da
Fix issue 10202: FP: constParameter (#3202) 2021-04-08 16:02:11 +02:00
Daniel Marjamäki
c8e661f61f assignmentInCondition: Clarify error message 2021-04-07 19:46:00 +02:00
Daniel Marjamäki
72802554c9 Fixed #3593 (New Check: Check for assignment within conditional expression) 2021-04-07 17:21:34 +02:00
fschwa
806dbf77b6
use size() instead of hard-coded length value (#3199)
Co-authored-by: Frederik Schwarzer <frederik.schwarzer@smart-battery-solutions.de>
2021-04-06 16:57:27 +02:00
Paul Fultz II
e0f9627201
Fix issue 10226: FP: redundant condition or invalid iterator (#3195) 2021-04-06 11:04:37 +02:00
Daniel Marjamäki
161ea81fd8 XML: Ensure file0 info is kept in multithreaded analysis. Write file0 attribute in top <error> element instead of in the <location> elements. 2021-04-05 12:03:39 +02:00
Paul Fultz II
e65ea8575f
Fix issue 10207: FP: derefInvalidIteratorRedundantCheck with ternary operator (#3197) 2021-04-05 11:10:43 +02:00
Paul Fultz II
f605f71e49
Fix issue 10225: false positive: knownConditionTrueFalse (#3196) 2021-04-05 10:20:14 +02:00
Yichen
8034a70bd3
Check for libc++ instead of clang to workaround a libc++ bug. (#3194) 2021-04-05 05:24:46 +02:00
Daniel Marjamäki
bc05ee62d5 CheckFunctions::checkIgnoredReturnValue; Fixed testrunner 2021-04-05 05:17:29 +02:00
Daniel Marjamäki
cf8a423636 Unreachable code; better handling of throw in C code 2021-04-05 04:53:07 +02:00
Daniel Marjamäki
a21c81365d one definition rule: Fixed false positive for 'class A::B ..' 2021-04-04 21:29:45 +02:00
Daniel Marjamäki
084bc74080 Fixed #8223 (false negative: Statements following return, break, continue, goto or throw will never be executed.) 2021-04-04 19:43:51 +02:00
Daniel Marjamäki
518fb01553 Fixed #8412 (ignoredReturnValue not issued when return value is changed but not really used (by logical not for example)) 2021-04-04 18:26:07 +02:00
Daniel Marjamäki
44f914eaee astyle formatting
ci skip
2021-04-04 18:20:32 +02:00
Oliver Stöneberg
6397e29f84
cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
Paul Fultz II
182ae75290
Fix issue 10216: FP containerOutOfBounds with std::array initialized with = {} (#3190) 2021-03-31 22:07:54 +02:00
Oliver Stöneberg
9b974f1b8e
fixed Visual Studio warnings about shadowed members (#3191) 2021-03-31 22:07:20 +02:00
Paul Fultz II
5077663684
Fix issue 9979: false positive: containerOutOfBounds with conditional resize (#3136) 2021-03-30 14:02:28 +02:00
Paul Fultz II
9de976b243
Fix issue 10194: hang with followAllReferences() (#3189)
* Decrease depth faster when there is multiple returns
2021-03-30 11:22:56 +02:00
Ken-Patrick Lehrmann
cddaa6d671
10221: Fix setVarId in template code (#3187)
The computation of the classname was not expecting templates. Simply
skipping the template part seems to fix the issue.
2021-03-29 12:16:02 +02:00
Lars Even Almaas
9786f1c34b
Suggested implementation for rule 8.2 (#3169) 2021-03-25 08:25:43 +01:00
Tomasz Kłoczko
8d6828847b
Another gcc11 fix (#3179)
/home/tkloczko/rpmbuild/BUILD/cppcheck-2.4/lib/symboldatabase.cpp: In member function ‘void SymbolDatabase::createSymbolDatabaseExprIds()’:
/home/tkloczko/rpmbuild/BUILD/cppcheck-2.4/lib/symboldatabase.cpp:1443:32: error: ‘numeric_limits’ is not a member of ‘std’
 1443 |                 if (id == std::numeric_limits<nonneg int>::max()) {
      |                                ^~~~~~~~~~~~~~
/home/tkloczko/rpmbuild/BUILD/cppcheck-2.4/lib/symboldatabase.cpp:1443:54: error: expected primary-expression before ‘int’
 1443 |                 if (id == std::numeric_limits<nonneg int>::max()) {
      |                                                      ^~~
/home/tkloczko/rpmbuild/BUILD/cppcheck-2.4/lib/symboldatabase.cpp:1443:47: error: expected ‘)’ before ‘int’
 1443 |                 if (id == std::numeric_limits<nonneg int>::max()) {
      |                    ~                          ^      ~~~
      |                                               )

This patch adds missing `include #include <limits>`

Co-authored-by: Your Name <you@example.com>
2021-03-22 18:43:08 +01:00
Daniel Marjamäki
cba0101df5 2.4: Set version 2021-03-21 21:25:54 +01:00
Daniel Marjamäki
42437277dc Update Copyright year 2021-03-21 20:58:32 +01:00
Daniel Marjamäki
51564504a8 astyle formatting 2021-03-20 18:54:46 +01:00
Daniel Marjamäki
b2691bda88 Fixed false positive in self check 2021-03-20 18:54:46 +01:00