cppcheck/lib
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
..
CMakeLists.txt
analyzer.h Update Copyright year 2021-03-21 20:58:32 +01:00
analyzerinfo.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
analyzerinfo.h Update Copyright year 2021-03-21 20:58:32 +01:00
astutils.cpp Fix compiler warning, non-static function 2021-04-22 18:40:44 +02:00
astutils.h cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
bughuntingchecks.cpp 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
bughuntingchecks.h
check.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
check.h Update Copyright year 2021-03-21 20:58:32 +01:00
check64bit.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
check64bit.h
checkassert.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
checkassert.h
checkautovariables.cpp Fix issue 10214: FP: danglingTempReference doesn't account for reference lifetime extension (#3220) 2021-04-19 14:20:29 +02:00
checkautovariables.h
checkbool.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checkbool.h
checkboost.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checkboost.h
checkbufferoverrun.cpp #10244: Fixed false negative: bufferAccessOutOfBounds 2021-04-13 16:40:38 +02:00
checkbufferoverrun.h #10244: Fixed false negative: bufferAccessOutOfBounds 2021-04-13 16:40:38 +02:00
checkclass.cpp added clang-tidy to CI (#3218) 2021-04-18 21:51:47 +02:00
checkclass.h cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checkcondition.cpp Fix issue 10208: FP: knownConditionTrueFalse in for loop with function that assigns by ref (#3198) 2021-04-18 21:42:27 +02:00
checkcondition.h assignmentInCondition: Clarify error message 2021-04-07 19:46:00 +02:00
checkexceptionsafety.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checkexceptionsafety.h Update Copyright year 2021-03-21 20:58:32 +01:00
checkfunctions.cpp CheckFunctions::checkIgnoredReturnValue; Fixed testrunner 2021-04-05 05:17:29 +02:00
checkfunctions.h
checkinternal.cpp
checkinternal.h Update Copyright year 2021-03-21 20:58:32 +01:00
checkio.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
checkio.h
checkleakautovar.cpp 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
checkleakautovar.h Update Copyright year 2021-03-21 20:58:32 +01:00
checkmemoryleak.cpp 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
checkmemoryleak.h
checknullpointer.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checknullpointer.h
checkother.cpp 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
checkother.h cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checkpostfixoperator.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checkpostfixoperator.h
checksizeof.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checksizeof.h
checkstl.cpp Fix issue 10012: False positive: mismatching container, not containers (#3222) 2021-04-19 09:17:02 +02:00
checkstl.h
checkstring.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checkstring.h
checktype.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checktype.h Removed integerOverflowOptimization checking and merged functionality into invalidTestForOverflow 2021-01-05 11:38:19 +01:00
checkuninitvar.cpp split "autoNoType" and "bailoutUninitVar" from more generic "debug" (#3209) 2021-04-16 15:19:29 +02:00
checkuninitvar.h 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
checkunusedfunctions.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checkunusedfunctions.h
checkunusedvar.cpp 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
checkunusedvar.h
checkvaarg.cpp 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
checkvaarg.h
config.h fixed/aligned some compiler warnings (#3065) 2021-01-21 18:13:32 +01:00
cppcheck.cpp 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
cppcheck.h cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
cppcheck.natvis
cppcheck.vcxproj 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
cppcheck.vcxproj.filters Visual Studio: Added missing file 2021-02-17 21:52:31 +01:00
ctu.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
ctu.h Update Copyright year 2021-03-21 20:58:32 +01:00
errorlogger.cpp Read error locations in the correct order from XML (#3226) 2021-04-22 14:28:33 +02:00
errorlogger.h cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
errortypes.cpp
errortypes.h Update Copyright year 2021-03-21 20:58:32 +01:00
exprengine.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
exprengine.h cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
forwardanalyzer.cpp Report an error if analysis becomes cyclic (#3173) 2021-03-20 14:02:07 +01:00
forwardanalyzer.h cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
importproject.cpp 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
importproject.h 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
lib.pri 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
library.cpp Fix issue 10208: FP: knownConditionTrueFalse in for loop with function that assigns by ref (#3198) 2021-04-18 21:42:27 +02:00
library.h Update Copyright year 2021-03-21 20:58:32 +01:00
matchcompiler.h
mathlib.cpp Check for libc++ instead of clang to workaround a libc++ bug. (#3194) 2021-04-05 05:24:46 +02:00
mathlib.h Update Copyright year 2021-03-21 20:58:32 +01:00
path.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
path.h Update Copyright year 2021-03-21 20:58:32 +01:00
pathanalysis.cpp
pathanalysis.h
pathmatch.cpp
pathmatch.h
pcrerules.pri
platform.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
platform.h
precompiled.h
preprocessor.cpp Preprocessor; Set proper __cplusplus define value 2021-04-25 21:16:04 +02:00
preprocessor.h
programmemory.cpp added clang-tidy to CI (#3218) 2021-04-18 21:51:47 +02:00
programmemory.h cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
reverseanalyzer.cpp Fix issue 10207: FP: derefInvalidIteratorRedundantCheck with ternary operator (#3197) 2021-04-05 11:10:43 +02:00
reverseanalyzer.h Update Copyright year 2021-03-21 20:58:32 +01:00
settings.cpp 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
settings.h 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
standards.h
summaries.cpp
summaries.h Update Copyright year 2021-03-21 20:58:32 +01:00
suppressions.cpp
suppressions.h Update Copyright year 2021-03-21 20:58:32 +01:00
symboldatabase.cpp Parser; fixed ast and auto type deduction for c++17 braced init lists 2021-04-25 10:38:33 +02:00
symboldatabase.h 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
templatesimplifier.cpp fix #10258 (coredump due to (?) template simplification) (#3228) 2021-04-22 22:23:01 +02:00
templatesimplifier.h improved compiler warnings about missing attributes (#3232) 2021-04-25 12:52:09 +02:00
timer.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
timer.h
token.cpp Handle c++20 spaceship operator 2021-04-22 19:15:22 +02:00
token.h Update Copyright year 2021-03-21 20:58:32 +01:00
tokenize.cpp Fix varId assignment for uses of variables declared in the if condition (#3231) 2021-04-26 07:38:03 +02:00
tokenize.h Parser; simplify (break out) init expression from if/switch/range-for 2021-04-25 14:37:27 +02:00
tokenlist.cpp Parser; fixed ast and auto type deduction for c++17 braced init lists 2021-04-25 10:38:33 +02:00
tokenlist.h 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
utils.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
utils.h cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
valueflow.cpp TemplateSimplifier; Better handling of c++17 fold expressions and c++20 concepts. 2021-04-20 15:40:25 +02:00
valueflow.h astyle formatting 2021-04-04 18:20:32 +02:00
valueptr.h
version.h 2.4: Set version 2021-03-21 21:25:54 +01:00
version.rc