Skip to content

Commit d112a5f

Browse files
committed
Use getTypeName()
1 parent 38c434f commit d112a5f

1 file changed

Lines changed: 1 addition & 10 deletions

File tree

‎lib/checkclass.cpp‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,18 +1675,9 @@ void CheckClassImpl::checkMemsetType(const Scope *start, const Token *tok, const
16751675
}
16761676
// don't warn if variable static or const, pointer or array of pointers
16771677
if (!var.isStatic() && !var.isConst() && !var.isPointer() && (!var.isArray() || var.typeEndToken()->str() != "*")) {
1678-
const Token *tok1 = var.typeStartToken();
16791678
const Scope *typeScope = var.typeScope();
16801679

1681-
std::string typeName;
1682-
if (Token::Match(tok1, "%type% ::")) {
1683-
const Token *typeTok = tok1;
1684-
while (Token::Match(typeTok, "%type% ::")) {
1685-
typeName += typeTok->str() + "::";
1686-
typeTok = typeTok->tokAt(2);
1687-
}
1688-
typeName += typeTok->str();
1689-
}
1680+
const std::string typeName = var.getTypeName();
16901681

16911682
// check for std:: type
16921683
if (var.isStlType() && typeName != "std::array" && !mSettings.library.podtype(typeName)) {

0 commit comments

Comments
 (0)