Skip to content

Commit fea194b

Browse files
authored
refs #13698 - exit early in Library::detect*() if token is a keyword (#7820)
1 parent fed91ac commit fea194b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/library.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,6 +1385,8 @@ const Library::Container* Library::detectContainerInternal(const Token* const ty
13851385
{
13861386
if (!typeStart)
13871387
return nullptr;
1388+
if (typeStart->isKeyword())
1389+
return nullptr;
13881390
const Token* firstLinkedTok = nullptr;
13891391
for (const Token* tok = typeStart; tok && !tok->varId(); tok = tok->next()) {
13901392
if (!tok->link())
@@ -1952,6 +1954,8 @@ const Library::SmartPointer* Library::detectSmartPointer(const Token* tok, bool
19521954
{
19531955
if (!tok)
19541956
return nullptr;
1957+
if (tok->isKeyword())
1958+
return nullptr;
19551959
std::string typestr = withoutStd ? "std::" : "";
19561960
if (tok->str() == "::")
19571961
tok = tok->next();

0 commit comments

Comments
 (0)