cppcheck/lib
Daniel Marjamäki f5fe5ca2dd
9768: Fix ast with throw in the middle of return (#2678)
* 9768: Fix ast with throw in the middle of return

```
int f(bool x)
{
    return x ? 0 : throw 0;
}
```

The `throw` part was not included in the ast, leading to an invalid
ternary operator.

* 8526: Fix ast construction for ternary operator

This tries to decide a bit more properly when ':' can be part of a
ternary operator. More precisely, there are some times when we want to
delay the construction of the ast for ':', so that it is place
accordingly to the matching '?'.

Typically, this fixes an issue with
`return val < 0 ? throw 1 : val;`,
where the ast for ':' would be constructed during as part of the
`throw`, and the ast for `?` would be invalid.

This patch is a bit of a hardcode, stating that we don't expect ':'
inside a throw, unless there is a complete ternary operator in there
(there can't be a range based for loop, a case in a switch). When we
reach ':', we know we are and the end of the `throw`.
2020-06-15 10:36:02 +02:00
..
CMakeLists.txt some CMake cleanups and additions (#2639) 2020-05-27 05:15:46 +02:00
analyzerinfo.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
analyzerinfo.h Update copyright year 2020-06-13 16:37:12 +02:00
astutils.cpp Fix issue 9718: False positive: Parameter can be declared const when written to via stream extraction operator (#2677) 2020-06-13 09:20:40 +02:00
astutils.h Fix issue 9587: False positive: parameter can be declared with const (#2667) 2020-05-31 10:10:10 +02:00
check.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
check.h made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
check64bit.cpp Update copyright year 2020-06-13 16:37:12 +02:00
check64bit.h
checkassert.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkassert.h
checkautovariables.cpp Fix issue 9587: False positive: parameter can be declared with const (#2667) 2020-05-31 10:10:10 +02:00
checkautovariables.h made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkbool.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkbool.h
checkboost.cpp Update copyright year 2020-06-13 16:37:12 +02:00
checkboost.h
checkbufferoverrun.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkbufferoverrun.h Update copyright year 2020-05-10 11:16:32 +02:00
checkclass.cpp optimized non-matchcompiled Token::simpleMatch() a bit (#2640) 2020-05-26 20:13:56 +02:00
checkclass.h Update copyright year 2020-05-10 11:16:32 +02:00
checkcondition.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkcondition.h made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkexceptionsafety.cpp
checkexceptionsafety.h made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkfunctions.cpp Update copyright year 2020-05-10 11:16:32 +02:00
checkfunctions.h Update copyright year 2020-06-13 16:37:12 +02:00
checkinternal.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkinternal.h Update copyright year 2020-05-10 11:16:32 +02:00
checkio.cpp Update copyright year 2020-05-10 11:16:32 +02:00
checkio.h Update copyright year 2020-06-13 16:37:12 +02:00
checkleakautovar.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkleakautovar.h Update copyright year 2020-06-13 16:37:12 +02:00
checkmemoryleak.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkmemoryleak.h made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checknullpointer.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checknullpointer.h Update copyright year 2020-06-13 16:37:12 +02:00
checkother.cpp astyle formatting 2020-06-01 08:59:34 +02:00
checkother.h made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkpostfixoperator.cpp Update copyright year 2020-06-13 16:37:12 +02:00
checkpostfixoperator.h
checksizeof.cpp Update copyright year 2020-06-13 16:37:12 +02:00
checksizeof.h
checkstl.cpp Fix issue 9548: False negative: Mismatching iterators when inserting into a vector (#2595) 2020-06-06 17:54:56 +02:00
checkstl.h astyle formatting 2020-06-08 00:50:45 +02:00
checkstring.cpp Update copyright year 2020-06-13 16:37:12 +02:00
checkstring.h
checktype.cpp Update copyright year 2020-06-13 16:37:12 +02:00
checktype.h Clarify signConversion warning message 2019-08-05 12:41:08 +02:00
checkuninitvar.cpp library: fixed handling of indirect attribute 2020-06-07 20:18:54 +02:00
checkuninitvar.h made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkunusedfunctions.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkunusedfunctions.h
checkunusedvar.cpp optimized non-matchcompiled Token::simpleMatch() a bit (#2640) 2020-05-26 20:13:56 +02:00
checkunusedvar.h Update copyright year 2020-05-10 11:16:32 +02:00
checkvaarg.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
checkvaarg.h
clangimport.cpp Refactorization: Fixed a couple of compiler warnings about reusing variable names 2020-05-19 08:35:12 +02:00
clangimport.h Clang import; Rename files/namespace 2020-01-10 16:29:06 +01:00
config.h Add generic valueflow forward analysis (#2511) 2020-02-13 16:27:06 +01:00
cppcheck.cpp Revert "Cleanup: Removed Tokenizer::simplifyTokenList2. As a side-effect, rules for "simple" token list are now executed on normal token list." (#2666) 2020-05-30 11:23:22 +02:00
cppcheck.h Revert "Cleanup: Removed Tokenizer::simplifyTokenList2. As a side-effect, rules for "simple" token list are now executed on normal token list." (#2666) 2020-05-30 11:23:22 +02:00
cppcheck.natvis
cppcheck.vcxproj Visual Studio: Use new files precompiled.h with several common includes for core and testrunner. 2020-05-29 12:16:04 +02:00
cppcheck.vcxproj.filters Visual Studio: Use new files precompiled.h with several common includes for core and testrunner. 2020-05-29 12:16:04 +02:00
ctu.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
ctu.h Update copyright year 2020-06-13 16:37:12 +02:00
errorlogger.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
errorlogger.h made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
errortypes.cpp astyle formatting 2020-05-23 07:30:22 +02:00
errortypes.h made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
exprengine.cpp Fix Cppcheck warning 2020-05-27 21:31:40 +02:00
exprengine.h ExprEngine; Fixed bug. Constraint expressions must be boolean 2020-05-27 19:37:07 +02:00
forwardanalyzer.cpp Running astyle [ci skip] 2020-06-14 10:06:54 +02:00
forwardanalyzer.h cleaned up includes based on include-what-you-use (#2632) 2020-05-10 16:45:45 +02:00
importproject.cpp Import project: Fix standard 2020-05-31 21:37:02 +02:00
importproject.h Import project: Speed up if --file-filter has been provided 2020-05-24 21:23:49 +02:00
lib.pri made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
library.cpp Running astyle [ci skip]. 2020-06-12 16:08:40 +02:00
library.h Library: simplified code and added test cases for validating <valid>-tag expressions 2020-06-12 16:06:43 +02:00
matchcompiler.h
mathlib.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
mathlib.h
path.cpp
path.h
pathanalysis.cpp Refactorization: Moved code from header to source 2020-05-19 08:35:12 +02:00
pathanalysis.h made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
pathmatch.cpp
pathmatch.h
pcrerules.pri
platform.cpp
platform.h Update copyright year 2020-05-10 11:16:32 +02:00
precompiled.h Visual Studio: Use new files precompiled.h with several common includes for core and testrunner. 2020-05-29 12:16:04 +02:00
preprocessor.cpp made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
preprocessor.h Update Copyright year 2019-12-21 11:23:01 +01:00
programmemory.cpp Fixed compilation (next attempt): Added more missing includes 2020-05-19 08:53:38 +02:00
programmemory.h made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
settings.cpp Revert "Cleanup: Removed Tokenizer::simplifyTokenList2. As a side-effect, rules for "simple" token list are now executed on normal token list." (#2666) 2020-05-30 11:23:22 +02:00
settings.h Revert "Cleanup: Removed Tokenizer::simplifyTokenList2. As a side-effect, rules for "simple" token list are now executed on normal token list." (#2666) 2020-05-30 11:23:22 +02:00
standards.h
suppressions.cpp Update copyright year 2020-05-10 11:16:32 +02:00
suppressions.h Update copyright year 2020-05-10 11:16:32 +02:00
symboldatabase.cpp Fixed #9746 (SymbolDatabase: Wrong valueType for return) 2020-06-10 21:13:53 +02:00
symboldatabase.h Fix issue 9587: False positive: parameter can be declared with const (#2667) 2020-05-31 10:10:10 +02:00
templatesimplifier.cpp optimized non-matchcompiled Token::simpleMatch() a bit (#2640) 2020-05-26 20:13:56 +02:00
templatesimplifier.h Resolve C4800 Visual C++ warning 2019-12-16 18:11:12 +03:00
timer.cpp Check for JSON error when parsing addon .json files + fixes (#2374) 2019-11-20 15:37:09 +01:00
timer.h Check for JSON error when parsing addon .json files + fixes (#2374) 2019-11-20 15:37:09 +01:00
token.cpp optimized non-matchcompiled Token::simpleMatch() a bit (#2640) 2020-05-26 20:13:56 +02:00
token.h optimized non-matchcompiled Token::simpleMatch() a bit (#2640) 2020-05-26 20:13:56 +02:00
tokenize.cpp Simplify empty anonymous namespaces. (#2673) 2020-06-07 13:49:04 +02:00
tokenize.h Revert "Cleanup: Removed Tokenizer::simplifyTokenList2. As a side-effect, rules for "simple" token list are now executed on normal token list." (#2666) 2020-05-30 11:23:22 +02:00
tokenlist.cpp 8526: Fix ast construction for ternary operator 2020-06-14 18:57:18 +02:00
tokenlist.h Fixed Token::isKeyword: Actually set this flag to a reasonable value in all code paths 2020-05-19 13:47:25 +02:00
utils.cpp Refactorization: Moved code from header to source 2020-05-19 08:35:12 +02:00
utils.h Fixed compilation (next attempt): Added more missing includes 2020-05-19 08:53:38 +02:00
valueflow.cpp valueFlowAfterAssign: variable initialization 2020-06-14 21:14:05 +02:00
valueflow.h Fix issue 9587: False positive: parameter can be declared with const (#2667) 2020-05-31 10:10:10 +02:00
valueptr.h Update copyright year 2020-05-10 11:16:32 +02:00
version.h Set version to 2.1.99 / 2.2 dev 2020-06-14 07:16:14 +02:00
version.rc