Skip to content

Commit fe6549e

Browse files
authored
refs #13698 - Library: generate proper types for lookup in detectSmartPointer() (#7378)
1 parent 3dbd78f commit fe6549e

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/library.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -1890,9 +1890,15 @@ bool Library::isSmartPointer(const Token* tok) const
18901890
const Library::SmartPointer* Library::detectSmartPointer(const Token* tok, bool withoutStd) const
18911891
{
18921892
std::string typestr = withoutStd ? "std::" : "";
1893-
while (Token::Match(tok, "%name%|::")) {
1894-
typestr += tok->str();
1893+
if (tok->str() == "::")
18951894
tok = tok->next();
1895+
while (Token::Match(tok, "%name% ::")) {
1896+
typestr += tok->str();
1897+
typestr += "::";
1898+
tok = tok->tokAt(2);
1899+
}
1900+
if (tok && tok->isName()) {
1901+
typestr += tok->str();
18961902
}
18971903
auto it = mData->mSmartPointers.find(typestr);
18981904
if (it == mData->mSmartPointers.end())

0 commit comments

Comments
 (0)