* Fix #11163 Hang on smart pointer with auto type deduction * Format * Format
This commit is contained in:
parent
a65f6952dc
commit
bd92e7411c
|
@ -6508,7 +6508,7 @@ static const Token* parsedecl(const Token* type,
|
|||
} else if (const Library::SmartPointer* smartPointer = settings->library.detectSmartPointer(type)) {
|
||||
const Token* argTok = Token::findsimplematch(type, "<");
|
||||
if (!argTok)
|
||||
continue;
|
||||
break;
|
||||
valuetype->smartPointer = smartPointer;
|
||||
valuetype->smartPointerTypeToken = argTok->next();
|
||||
valuetype->smartPointerType = argTok->next()->type();
|
||||
|
|
|
@ -490,6 +490,7 @@ private:
|
|||
TEST_CASE(auto14);
|
||||
TEST_CASE(auto15); // C++17 auto deduction from braced-init-list
|
||||
TEST_CASE(auto16);
|
||||
TEST_CASE(auto17); // #11163
|
||||
|
||||
TEST_CASE(unionWithConstructor);
|
||||
|
||||
|
@ -8601,6 +8602,18 @@ private:
|
|||
ASSERT_EQUALS(ValueType::Type::RECORD, i->valueType()->type);
|
||||
}
|
||||
|
||||
void auto17() { // #11163 don't hang
|
||||
GET_SYMBOL_DB("void f() {\n"
|
||||
" std::shared_ptr<int> s1;\n"
|
||||
" auto s2 = std::shared_ptr(s1);\n"
|
||||
"}\n"
|
||||
"void g() {\n"
|
||||
" std::shared_ptr<int> s;\n"
|
||||
" auto w = std::weak_ptr(s);\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS(5, db->variableList().size());
|
||||
}
|
||||
|
||||
void unionWithConstructor() {
|
||||
GET_SYMBOL_DB("union Fred {\n"
|
||||
" Fred(int x) : i(x) { }\n"
|
||||
|
|
Loading…
Reference in New Issue