Skip to content

Commit 82aa259

Browse files
Update token.cpp
1 parent 4087735 commit 82aa259

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/token.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2459,7 +2459,7 @@ std::pair<const Token*, const Token*> Token::typeDecl(const Token* tok, bool poi
24592459
typeBeg = previousBeforeAstLeftmostLeaf(tok2);
24602460
typeEnd = tok2;
24612461
}
2462-
if (typeBeg)
2462+
if (typeBeg && typeBeg != typeEnd)
24632463
result = { typeBeg->next(), typeEnd }; // handle smart pointers/iterators first
24642464
}
24652465
if (astIsRangeBasedForDecl(var->nameToken()) && astIsContainer(var->nameToken()->astParent()->astOperand2())) { // range-based for

0 commit comments

Comments
 (0)