From 45c5860ca44b1c716febb13a1c5342858e0698fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 2 Mar 2017 22:24:26 +0100 Subject: [PATCH] Fixed #7926 (Memory Leak with auto not detected) --- lib/symboldatabase.cpp | 2 +- test/testsymboldatabase.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index b3f32d761..a8528d820 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -4852,7 +4852,7 @@ void SymbolDatabase::setValueTypeInTokenList(Token *tokens, bool cpp, const Sett vt.pointer = 1; const Token * const typeTok = tok->next(); vt.type = ValueType::typeFromString(typeTok->str(), typeTok->isLong()); - if (vt.type == ValueType::Type::UNKNOWN_TYPE && typeTok->isStandardType()) + if (vt.type == ValueType::Type::UNKNOWN_TYPE) vt.fromLibraryType(typeTok->str(), settings); if (typeTok->isUnsigned()) vt.sign = ValueType::Sign::UNSIGNED; diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index 38841982d..3cd5b9603 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -4291,6 +4291,7 @@ private: ValueType vt; ASSERT_EQUALS(true, vt.fromLibraryType("u32", &settingsWin64)); ASSERT_EQUALS(ValueType::Type::INT, vt.type); + ASSERT_EQUALS("unsigned int *", typeOf(";void *data = new u32[10];", "new", "test.cpp", &settingsWin64)); } { // PlatformType