cppcheck/test
dummyunit b18e6f1e10
Fix varId assignment for uses of variables declared in the if condition (#3231)
Variables declared in the if condition (or in C++17 init-statement) are
visible not only in the if body but also in the else body. But logic in
Tokenizer::setVarIdPass1() handled such variables as if they were
declared in the if body.

As the result they were removed from variablesMap by the time the else
block was parsed and their uses in the else block were either given an
incorrect varId from variables in some outer scope or not given a varId
at all.

This then resulted in false positive unreadVariable errors for variables
declared in the if condition (or init-statement) and used only in the
else block.

Simplification from "else if ..." to "else { if ... }" was moved before
setVarId() to simplify detection for ends of blocks in if-else chains.
2021-04-26 07:38:03 +02:00
..
bug-hunting some Python cleanups based on PyCharm inspections (#2999) 2021-01-31 14:27:11 +01:00
cfg Fix issue 10208: FP: knownConditionTrueFalse in for loop with function that assigns by ref (#3198) 2021-04-18 21:42:27 +02:00
cli Clang import; This experimental feature didn't "take off" much. After a lot of work we are still far fram the goal. I remove it now but don't rule out completely that it could ever be added again. 2021-04-21 18:59:48 +02:00
synthetic
testsuites
CMakeLists.txt fix w64-mingw32-ld linking error (#3184) 2021-03-29 17:04:42 +02:00
options.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
options.h
precompiled.h Update Copyright year 2021-03-21 20:58:32 +01:00
redirect.h
test.cxx
test64bit.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testassert.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testastutils.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testautovariables.cpp Fix issue 10214: FP: danglingTempReference doesn't account for reference lifetime extension (#3220) 2021-04-19 14:20:29 +02:00
testbool.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testboost.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testbufferoverrun.cpp #10244: Fixed false negative: bufferAccessOutOfBounds 2021-04-13 16:40:38 +02:00
testbughuntingchecks.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testcharvar.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testclass.cpp Running astyle [ci skip] 2021-04-09 08:46:47 +02:00
testcmdlineparser.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
testcondition.cpp Fix issue 10235: Regression: oppositeInnerCondition (#3223) 2021-04-19 09:15:03 +02:00
testconstructors.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testcppcheck.cpp
testerrorlogger.cpp astyle formatting 2021-04-22 19:08:24 +02:00
testexceptionsafety.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testexprengine.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
testfilelister.cpp Check stat return value in addFiles2 (#3214) 2021-04-18 21:52:14 +02:00
testfunctions.cpp 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
testgarbage.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testimportproject.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testincompletestatement.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testinternal.cpp
testio.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testleakautovar.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testlibrary.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
testmathlib.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testmemleak.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
testnullpointer.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testoptions.cpp
testother.cpp Unreachable code; better handling of throw in C code 2021-04-05 04:53:07 +02:00
testpath.cpp
testpathmatch.cpp
testplatform.cpp
testpostfixoperator.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testpreprocessor.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testrunner.cpp
testrunner.vcxproj
testrunner.vcxproj.filters
testsamples.cpp Check stat return value in addFiles2 (#3214) 2021-04-18 21:52:14 +02:00
testsimplifytemplate.cpp fix #10258 (coredump due to (?) template simplification) (#3228) 2021-04-22 22:23:01 +02:00
testsimplifytokens.cpp Fixed #9214 (Tests are run on simplified token list) 2021-04-06 21:21:53 +02:00
testsimplifytypedef.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testsimplifyusing.cpp fix simplifyUsing debug warning for: using value_type = const ValueFlow::Value; (#3211) 2021-04-17 14:20:16 +02:00
testsizeof.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
teststl.cpp Fix issue 10012: False positive: mismatching container, not containers (#3222) 2021-04-19 09:17:02 +02:00
teststring.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testsuite.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testsuite.h Update Copyright year 2021-03-21 20:58:32 +01:00
testsummaries.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testsuppressions.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
testsymboldatabase.cpp Parser; fixed ast and auto type deduction for c++17 braced init lists 2021-04-25 10:38:33 +02:00
testthreadexecutor.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
testtimer.cpp
testtoken.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testtokenize.cpp Parser; simplify (break out) init expression from if/switch/range-for 2021-04-25 14:37:27 +02:00
testtokenlist.cpp
testtype.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testuninitvar.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testunusedfunctions.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
testunusedprivfunc.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testunusedvar.cpp Fix varId assignment for uses of variables declared in the if condition (#3231) 2021-04-26 07:38:03 +02:00
testutils.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testutils.h Update Copyright year 2021-03-21 20:58:32 +01:00
testvaarg.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testvalueflow.cpp Fix issue 9932: FP: containerOutOfBounds (#3217) 2021-04-18 10:43:38 +02:00
testvarid.cpp Fix varId assignment for uses of variables declared in the if condition (#3231) 2021-04-26 07:38:03 +02:00