diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 7676099dc..2c02b66fb 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1127,6 +1127,9 @@ void SymbolDatabase::createSymbolDatabaseSetScopePointers() start = const_cast(_tokenizer->list.front()); end = const_cast(_tokenizer->list.back()); } + assert((start == nullptr) == (end == nullptr)); + if (start == nullptr) + continue; start->scope(&*it); end->scope(&*it); diff --git a/test/teststl.cpp b/test/teststl.cpp index 6249160ac..c03207388 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -2227,7 +2227,7 @@ private: check("const char* foo() {\n" " static std::string text;\n" - " text = \"hello world\\n\";\n" + " text = \"hello world\n\";\n" " return text.c_str();\n" "}"); ASSERT_EQUALS("", errout.str()); // #3427