From 950c021614f2ae4d43e5bd44cc92c0ddc89b3f81 Mon Sep 17 00:00:00 2001 From: firewave Date: Fri, 12 Sep 2025 19:16:55 +0200 Subject: [PATCH] refs #13698 - exit early in `Library::detect*()` if token is a keyword --- lib/library.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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();