cppcheck/lib
Ken-Patrick Lehrmann b3b3b6b2a1
Fix handling of namespace scope with several bodystarts (#3438)
Follow up to 0093452bed.
Give the proper end to getVariableList, since it might not be bodyEnd.

Before that, getVariableList would add the same variables in several
unrelated scopes, and all kind of false positive would follow.

For instance, with the case I added in the unit-tests, I had:
```
../code.cpp:15:18: warning: The struct 'is_A' defines member variable with name 'foo' also defined in its parent struct 'is_A_impl'. [duplInheritedMember]
static const int foo = 8;
                 ^
../code.cpp:15:18: note: Parent variable 'is_A_impl::foo'
static const int foo = 8;
                 ^
../code.cpp:15:18: note: Derived variable 'is_A::foo'
static const int foo = 8;
                 ^
../code.cpp:15:18: style: struct member 'has_A::foo' is never used. [unusedStructMember]
static const int foo = 8;
                 ^
../code.cpp:15:18: style: struct member 'is_A::foo' is never used. [unusedStructMember]
static const int foo = 8;
                 ^
```
2021-09-04 11:09:33 +02:00
..
CMakeLists.txt lib: Add condition for include externals/tinyxml2 (#2923) 2020-11-27 09:57:12 +01:00
analyzer.h Fix FP when calling a function in a condition (#3412) 2021-08-21 18:52:11 +02:00
analyzerinfo.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
analyzerinfo.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
astutils.cpp Remove usage of std::vector and getArguments from getTokenArgumentFunction (#3435) 2021-09-01 10:51:44 +02:00
astutils.h Add library configurations for free functions like std::size, std::empty, etc (#3410) 2021-08-23 09:03:48 +02:00
bughuntingchecks.cpp Revert "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-30 16:47:02 +02:00
bughuntingchecks.h Add 'bughuntingchecks' 2020-06-19 13:16:48 +02:00
check.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
check.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
check64bit.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
check64bit.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkassert.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
checkassert.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkautovariables.cpp Fix todo test for returning a dangling reference (#3284) 2021-06-04 17:15:39 +02:00
checkautovariables.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkbool.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkbool.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkboost.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkboost.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkbufferoverrun.cpp argumentSize: Clarify error message 2021-08-29 15:38:58 +02:00
checkbufferoverrun.h argumentSize: Clarify error message 2021-08-29 15:38:58 +02:00
checkclass.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkclass.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkcondition.cpp Fix FP in checkCompareValueOutOfTypeRange when sign is unknown 2021-08-29 16:03:56 +02:00
checkcondition.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkexceptionsafety.cpp Typos found by running "codespell" (#3324) 2021-07-02 17:41:51 +02:00
checkexceptionsafety.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkfunctions.cpp Removed missingReturn inconclusive warnings, that was too noisy 2021-09-01 19:50:17 +02:00
checkfunctions.h Removed missingReturn inconclusive warnings, that was too noisy 2021-09-01 19:50:17 +02:00
checkinternal.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkinternal.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkio.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkio.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkleakautovar.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkleakautovar.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkmemoryleak.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkmemoryleak.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checknullpointer.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checknullpointer.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkother.cpp Fixed #10397 (FP constParameter - implementing an interface) 2021-08-10 15:37:59 +02:00
checkother.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkpostfixoperator.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checkpostfixoperator.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checksizeof.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checksizeof.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkstl.cpp Fix 7524: ValueFlow: false path for 'x<3' (#3393) 2021-08-16 09:19:07 +02:00
checkstl.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkstring.cpp cleaned up includes based on include-what-you-use (#3141) 2021-04-03 21:30:50 +02:00
checkstring.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checktype.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checktype.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkuninitvar.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkuninitvar.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkunusedfunctions.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkunusedfunctions.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkunusedvar.cpp Symboldatabase: Improve valuetypes for containers, iterators, and smart pointers (#3398) 2021-08-14 19:00:58 +02:00
checkunusedvar.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkvaarg.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
checkvaarg.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
clangimport.cpp Revert "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-30 16:47:02 +02:00
clangimport.h Revert "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-30 16:47:02 +02:00
color.cpp Fix MSVC build and some warnings (#3334) 2021-07-16 21:55:12 +02:00
color.h Fix MSVC build and some warnings (#3334) 2021-07-16 21:55:12 +02:00
config.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
cppcheck.cpp Dont require __main__ for an addon (#3363) 2021-08-12 20:17:51 +02:00
cppcheck.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
cppcheck.natvis
cppcheck.vcxproj Fix MSVC build and some warnings (#3334) 2021-07-16 21:55:12 +02:00
cppcheck.vcxproj.filters Fix MSVC build and some warnings (#3334) 2021-07-16 21:55:12 +02:00
ctu.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
ctu.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
errorlogger.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
errorlogger.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
errortypes.cpp astyle formatting 2020-05-23 07:30:22 +02:00
errortypes.h Update Copyright year 2021-03-21 20:58:32 +01:00
exprengine.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
exprengine.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
forwardanalyzer.cpp Fix 10438: FP knownConditionTrueFalse after return in a catch clause (#3429) 2021-09-03 23:07:08 +02:00
forwardanalyzer.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
importproject.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
importproject.h ImportProject; Try to use relative paths 2021-06-12 11:10:35 +02:00
lib.pri Add colors to CLI reporting (#3304) 2021-07-08 21:21:35 +02:00
library.cpp Add library configurations for free functions like std::size, std::empty, etc (#3410) 2021-08-23 09:03:48 +02:00
library.h Add library configurations for free functions like std::size, std::empty, etc (#3410) 2021-08-23 09:03:48 +02:00
matchcompiler.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
mathlib.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
mathlib.h Refactoring; Reuse simplecpp::characterLiteralToLL 2021-05-02 13:44:37 +02:00
path.cpp feat: add support for .ipp and .ixx extensions (#3383) 2021-08-09 10:46:56 +02:00
path.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
pathanalysis.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
pathanalysis.h made check.h less heavy (#2633) 2020-05-23 07:16:49 +02:00
pathmatch.cpp Update Copyright year 2020-10-03 09:15:56 +02:00
pathmatch.h
pcrerules.pri
platform.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
platform.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +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 Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
preprocessor.h misra; implemented rule 20.8 2021-07-22 08:46:28 +02:00
programmemory.cpp Fix 10410: FP nullPointerRedundantCheck on if (a || b ) followed by if ( b ) (#3427) 2021-08-29 15:39:41 +02:00
programmemory.h Fix crash in programmemory, crash found in daca@home package system-root 2021-08-25 06:56:19 +02:00
reverseanalyzer.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
reverseanalyzer.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
settings.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
settings.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
standards.h Update Copyright year 2020-10-03 09:15:56 +02:00
summaries.cpp Summaries: Moved to its own files 2020-12-20 19:53:58 +01:00
summaries.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
suppressions.cpp Refactor: fix member shadowing, return by const ref (#3407) 2021-08-21 22:00:45 +02:00
suppressions.h Refactor: fix member shadowing, return by const ref (#3407) 2021-08-21 22:00:45 +02:00
symboldatabase.cpp Fix handling of namespace scope with several bodystarts (#3438) 2021-09-04 11:09:33 +02:00
symboldatabase.h Fix handling of namespace scope with several bodystarts (#3438) 2021-09-04 11:09:33 +02:00
templatesimplifier.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
templatesimplifier.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
timer.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
timer.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
token.cpp Fix 10435: False positive: containerOutOfBounds (#3426) 2021-08-29 15:40:10 +02:00
token.h Fix 10435: False positive: containerOutOfBounds (#3426) 2021-08-29 15:40:10 +02:00
tokenize.cpp Tokenizer: Add 'enum struct' pattern 2021-08-30 20:18:06 +02:00
tokenize.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
tokenlist.cpp Validate asserts in the AST to fix crash in 10442 (#3428) 2021-08-29 20:45:31 +02:00
tokenlist.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
tokenrange.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
utils.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
utils.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
valueflow.cpp Fix 10318: iterator converted to type, wrong scope check (#3433) 2021-08-31 09:48:23 +02:00
valueflow.h Deduce symbolic values from conditions (#3406) 2021-08-19 22:01:55 +02:00
valueptr.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
version.h Set debug version 2021-07-04 11:19:08 +02:00
version.rc