Skip to content

Commit 693ea20

Browse files
committed
refs #13698 - Library: avoid impossible type lookups
1 parent c9120e3 commit 693ea20

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/library.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1327,6 +1327,13 @@ const Library::Container* Library::detectContainerInternal(const Token* const ty
13271327
if (typeStart->tokType() != Token::Type::eType && typeStart->tokType() != Token::Type::eName) {
13281328
return nullptr;
13291329
}
1330+
// bail out on function declarations (without implementation)
1331+
if (typeStart->tokType() == Token::Type::eName &&
1332+
typeStart->previous() &&
1333+
typeStart->previous()->tokType() == Token::Type::eType) {
1334+
return nullptr;
1335+
}
1336+
// TODO: bail out on standard types
13301337
const Token* firstLinkedTok = nullptr;
13311338
for (const Token* tok = typeStart; tok && !tok->varId(); tok = tok->next()) {
13321339
if (!tok->link())

0 commit comments

Comments
 (0)