Skip to content

Commit 8cf4a4b

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/library.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,11 @@ const Library::Container* Library::detectContainerInternal(const Token* const ty
13301330
// bail out on function declarations (without implementation)
13311331
if (typeStart->tokType() == Token::Type::eName &&
13321332
typeStart->previous() &&
1333-
typeStart->previous()->tokType() == Token::Type::eType) {
1333+
(typeStart->previous()->tokType() == Token::Type::eType || // return type
1334+
typeStart->previous()->tokType() == Token::Type::eArithmeticalOp || // *
1335+
typeStart->previous()->tokType() == Token::Type::eOther || // ::
1336+
typeStart->previous()->tokType() == Token::Type::eName // qualified return type
1337+
)) {
13341338
return nullptr;
13351339
}
13361340
// TODO: bail out on standard types

0 commit comments

Comments
 (0)