cppcheck/test
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
..
bug-hunting Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
cfg Fix FP when calling a function in a condition (#3412) 2021-08-21 18:52:11 +02:00
cli Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
synthetic Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testsuites Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
CMakeLists.txt Dont require __main__ for an addon (#3363) 2021-08-12 20:17:51 +02:00
options.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
options.h Add colors to CLI reporting (#3304) 2021-07-08 21:21:35 +02:00
precompiled.h Update Copyright year 2021-03-21 20:58:32 +01:00
redirect.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
test.cxx
test64bit.cpp #8631: Added regression test 2021-08-23 08:51:54 +02:00
testassert.cpp Validate asserts in the AST to fix crash in 10442 (#3428) 2021-08-29 20:45:31 +02:00
testastutils.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testautovariables.cpp Regression test for 9811: False positive: Reference to temporary returned (#3434) 2021-08-31 09:48:50 +02:00
testbool.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testboost.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testbufferoverrun.cpp argumentSize: Clarify error message 2021-08-29 15:38:58 +02:00
testbughuntingchecks.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testcharvar.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testclangimport.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testclass.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testcmdlineparser.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testcondition.cpp Fix 10438: FP knownConditionTrueFalse after return in a catch clause (#3429) 2021-09-03 23:07:08 +02:00
testconstructors.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testcppcheck.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testerrorlogger.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testexceptionsafety.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testexprengine.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testfilelister.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testfunctions.cpp Removed missingReturn inconclusive warnings, that was too noisy 2021-09-01 19:50:17 +02:00
testgarbage.cpp Fix 9245: Synax error on valid C++14 code: AST broken, binary operator '=' doesn't have two operands. (#3400) 2021-08-14 22:50:58 +02:00
testimportproject.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testincompletestatement.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testinternal.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testio.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testleakautovar.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testlibrary.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testmathlib.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testmemleak.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testnullpointer.cpp Regression test for 8742: False positive: ValueFlow regression (#3444) 2021-09-04 08:45:55 +02:00
testoptions.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testother.cpp Fixed #10397 (FP constParameter - implementing an interface) 2021-08-10 15:37:59 +02:00
testpath.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testpathmatch.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testplatform.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testpostfixoperator.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testpreprocessor.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testrunner.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testrunner.vcxproj Fix MSVC build and some warnings (#3334) 2021-07-16 21:55:12 +02:00
testrunner.vcxproj.filters Remove TestSamples 2021-07-10 21:04:38 +02:00
testsimplifytemplate.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testsimplifytokens.cpp Fix 10435: False positive: containerOutOfBounds (#3426) 2021-08-29 15:40:10 +02:00
testsimplifytypedef.cpp Simplify Typedef: Fixed typedef simplification in expanded tokens 2021-08-29 19:14:53 +02:00
testsimplifyusing.cpp TestSimplifyUsing; code cleanup 2021-08-21 10:39:53 +02:00
testsizeof.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
teststl.cpp Add test case for #10383 (#3421) 2021-08-26 19:37:29 +02:00
teststring.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testsuite.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testsuite.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testsummaries.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testsuppressions.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testsymboldatabase.cpp Fix handling of namespace scope with several bodystarts (#3438) 2021-09-04 11:09:33 +02:00
testthreadexecutor.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testtimer.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testtoken.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testtokenize.cpp Fixed #10403 (Wrong AST for destructor call) 2021-08-28 22:11:30 +02:00
testtokenlist.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testtokenrange.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testtype.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testuninitvar.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testunusedfunctions.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testunusedprivfunc.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testunusedvar.cpp Fixed #10095 (False positive: unreadVariable) 2021-08-27 17:37:42 +02:00
testutils.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testutils.h Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00
testvaarg.cpp Update Copyright year 2021-03-21 20:58:32 +01:00
testvalueflow.cpp Fix 10348: FP knownConditionTrueFalse with condition variable in do ... while loop (#3422) 2021-08-27 05:46:57 +02:00
testvarid.cpp Format with uncrustify (#3388) 2021-08-07 20:51:18 +02:00