Fixed #7784 (Token: can't be both type and variable)

This commit is contained in:
Daniel Marjamäki 2016-11-26 22:39:47 +01:00
parent 55ae961ac2
commit b6cba4a55c
2 changed files with 10 additions and 2 deletions

View File

@ -492,10 +492,12 @@ public:
}
void varId(unsigned int id) {
_varId = id;
if (id != 0)
if (id != 0) {
_tokType = eVariable;
else
isStandardType(false);
} else {
update_property_info();
}
}
/**

View File

@ -830,6 +830,12 @@ private:
// Change back to standard type
tok.str("int");
ASSERT_EQUALS(true, tok.isStandardType());
// token can't be both type and variable
tok.str("abc");
tok.isStandardType(true);
tok.varId(123);
ASSERT_EQUALS(false, tok.isStandardType());
}
void updateProperties() const {