diff --git a/lib/library.cpp b/lib/library.cpp index f786584bdf2..cb3bc144c9c 100644 --- a/lib/library.cpp +++ b/lib/library.cpp @@ -1385,6 +1385,8 @@ const Library::Container* Library::detectContainerInternal(const Token* const ty { if (!typeStart) return nullptr; + if (typeStart->isKeyword()) + return nullptr; const Token* firstLinkedTok = nullptr; for (const Token* tok = typeStart; tok && !tok->varId(); tok = tok->next()) { if (!tok->link()) @@ -1952,6 +1954,8 @@ const Library::SmartPointer* Library::detectSmartPointer(const Token* tok, bool { if (!tok) return nullptr; + if (tok->isKeyword()) + return nullptr; std::string typestr = withoutStd ? "std::" : ""; if (tok->str() == "::") tok = tok->next();