Skip to content

Commit dfa928f

Browse files
authored
Token: make sure calls are being match compiled (#6480)
1 parent 9526289 commit dfa928f

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Diff for: lib/token.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ const Token * Token::findClosingBracket() const
966966
}
967967
// save named template parameter
968968
else if (templateParameter && depth == 1 && Token::Match(closing, "[,=]") &&
969-
closing->previous()->isName() && !Match(closing->previous(), "class|typename|."))
969+
closing->previous()->isName() && !Token::Match(closing->previous(), "class|typename|."))
970970
templateParameters.insert(closing->strAt(-1));
971971
}
972972

@@ -2330,6 +2330,13 @@ void Token::setValueType(ValueType *vt)
23302330
}
23312331
}
23322332

2333+
const ValueType *Token::argumentType() const {
2334+
const Token *top = this;
2335+
while (top && !Token::Match(top->astParent(), ",|("))
2336+
top = top->astParent();
2337+
return top ? top->mImpl->mValueType : nullptr;
2338+
}
2339+
23332340
void Token::type(const ::Type *t)
23342341
{
23352342
mImpl->mType = t;

Diff for: lib/token.h

+1-6
Original file line numberDiff line numberDiff line change
@@ -333,12 +333,7 @@ class CPPCHECKLIB Token {
333333
}
334334
void setValueType(ValueType *vt);
335335

336-
const ValueType *argumentType() const {
337-
const Token *top = this;
338-
while (top && !Token::Match(top->astParent(), ",|("))
339-
top = top->astParent();
340-
return top ? top->mImpl->mValueType : nullptr;
341-
}
336+
const ValueType *argumentType() const;
342337

343338
Token::Type tokType() const {
344339
return mTokType;

0 commit comments

Comments
 (0)