Fixed #9038 (Auto type with explicit pointer symbol detected as integer)
This commit is contained in:
parent
f1f9f1f6fb
commit
219180b00a
|
@ -5672,6 +5672,8 @@ static const Token * parsedecl(const Token *type, ValueType * const valuetype, V
|
||||||
valuetype->smartPointerType = argTok->next()->type();
|
valuetype->smartPointerType = argTok->next()->type();
|
||||||
valuetype->type = ValueType::Type::NONSTD;
|
valuetype->type = ValueType::Type::NONSTD;
|
||||||
type = argTok->link();
|
type = argTok->link();
|
||||||
|
if (type)
|
||||||
|
type = type->next();
|
||||||
continue;
|
continue;
|
||||||
} else if (Token::Match(type, "%name% :: %name%")) {
|
} else if (Token::Match(type, "%name% :: %name%")) {
|
||||||
std::string typestr;
|
std::string typestr;
|
||||||
|
|
|
@ -156,6 +156,7 @@ private:
|
||||||
TEST_CASE(VariableValueType2);
|
TEST_CASE(VariableValueType2);
|
||||||
TEST_CASE(VariableValueType3);
|
TEST_CASE(VariableValueType3);
|
||||||
TEST_CASE(VariableValueType4); // smart pointer type
|
TEST_CASE(VariableValueType4); // smart pointer type
|
||||||
|
TEST_CASE(VariableValueType5); // smart pointer type
|
||||||
|
|
||||||
TEST_CASE(findVariableType1);
|
TEST_CASE(findVariableType1);
|
||||||
TEST_CASE(findVariableType2);
|
TEST_CASE(findVariableType2);
|
||||||
|
@ -950,6 +951,16 @@ private:
|
||||||
ASSERT(x->valueType()->smartPointerType);
|
ASSERT(x->valueType()->smartPointerType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VariableValueType5() {
|
||||||
|
GET_SYMBOL_DB("class C {};\n"
|
||||||
|
"void foo(std::shared_ptr<C>* p) {}\n");
|
||||||
|
|
||||||
|
const Variable* const p = db->getVariableFromVarId(1);
|
||||||
|
ASSERT(p->valueType());
|
||||||
|
ASSERT(p->valueType()->smartPointerTypeToken);
|
||||||
|
ASSERT(p->valueType()->pointer == 1);
|
||||||
|
}
|
||||||
|
|
||||||
void findVariableType1() {
|
void findVariableType1() {
|
||||||
GET_SYMBOL_DB("class A {\n"
|
GET_SYMBOL_DB("class A {\n"
|
||||||
"public:\n"
|
"public:\n"
|
||||||
|
|
Loading…
Reference in New Issue