@@ -3719,14 +3719,13 @@ class TestUninitVar : public TestFixture {
37193719
37203720#define valueFlowUninit (...) valueFlowUninit_(__FILE__, __LINE__, __VA_ARGS__)
37213721 template <size_t size>
3722- void valueFlowUninit_ (const char * file, int line, const char (&code)[size], bool cpp = true, const Settings* pSettings = nullptr )
3722+ void valueFlowUninit_ (const char * file, int line, const char (&code)[size], bool cpp = true)
37233723 {
3724- const Settings& s = pSettings ? *pSettings : settings;
3725- SimpleTokenizer tokenizer (s, *this , cpp);
3724+ SimpleTokenizer tokenizer (settings, *this , cpp);
37263725 ASSERT_LOC (tokenizer.tokenize (code), file, line);
37273726
37283727 // Check for redundant code..
3729- CheckUninitVarImpl checkuninitvar (&tokenizer, s , *this );
3728+ CheckUninitVarImpl checkuninitvar (&tokenizer, settings , *this );
37303729 (checkuninitvar.valueFlowUninit )();
37313730 }
37323731
@@ -7949,15 +7948,14 @@ class TestUninitVar : public TestFixture {
79497948 void valueFlowUninitErrorPath ()
79507949 {
79517950 setMultiline ();
7952- Settings s = settings;
7953- s.templateLocation = " {file}:{line}:note:{info}\n " ;
7951+
79547952 valueFlowUninit (" void f(bool b) {\n "
79557953 " int i;\n "
79567954 " if (b)\n "
79577955 " return i;\n "
79587956 " i = 1;\n "
79597957 " return i;\n "
7960- " }\n " , &s );
7958+ " }\n " );
79617959 ASSERT_EQUALS (" [test.cpp:4:16]: warning: Uninitialized variable: i [uninitvar]\n "
79627960 " [test.cpp:3:9]: note: Assuming condition is true\n "
79637961 " [test.cpp:4:16]: note: Uninitialized variable: i\n " ,
0 commit comments