clang warnings (#1547)
* valueflow: remove unused variable known sincee4677ae640
will trigger : lib/valueflow.cpp:506:20: warning: unused variable 'known' [-Wunused-variable] const bool known = (parent->astOperand1()->hasKnownValue() || * templatesimplifier: cleanup since48c960f56c
showing: lib/templatesimplifier.h:279:16: warning: private field 'mTokenizer' is not used [-Wunused-private-field] Tokenizer *mTokenizer;
This commit is contained in:
parent
3f318548e2
commit
5ae6861a0f
|
@ -74,7 +74,7 @@ TemplateSimplifier::TokenAndName::~TokenAndName()
|
||||||
}
|
}
|
||||||
|
|
||||||
TemplateSimplifier::TemplateSimplifier(Tokenizer *tokenizer)
|
TemplateSimplifier::TemplateSimplifier(Tokenizer *tokenizer)
|
||||||
: mTokenizer(tokenizer), mTokenList(tokenizer->list), mSettings(tokenizer->mSettings), mErrorLogger(tokenizer->mErrorLogger)
|
: mTokenList(tokenizer->list), mSettings(tokenizer->mSettings), mErrorLogger(tokenizer->mErrorLogger)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -276,7 +276,6 @@ private:
|
||||||
Token *tok2,
|
Token *tok2,
|
||||||
std::list<std::string> &typeStringsUsedInTemplateInstantiation);
|
std::list<std::string> &typeStringsUsedInTemplateInstantiation);
|
||||||
|
|
||||||
Tokenizer *mTokenizer;
|
|
||||||
TokenList &mTokenList;
|
TokenList &mTokenList;
|
||||||
const Settings *mSettings;
|
const Settings *mSettings;
|
||||||
ErrorLogger *mErrorLogger;
|
ErrorLogger *mErrorLogger;
|
||||||
|
|
|
@ -503,8 +503,6 @@ static void setTokenValue(Token* tok, const ValueFlow::Value &value, const Setti
|
||||||
else if ((parent->isArithmeticalOp() || parent->isComparisonOp() || (parent->tokType() == Token::eBitOp) || (parent->tokType() == Token::eLogicalOp)) &&
|
else if ((parent->isArithmeticalOp() || parent->isComparisonOp() || (parent->tokType() == Token::eBitOp) || (parent->tokType() == Token::eLogicalOp)) &&
|
||||||
parent->astOperand1() &&
|
parent->astOperand1() &&
|
||||||
parent->astOperand2()) {
|
parent->astOperand2()) {
|
||||||
const bool known = (parent->astOperand1()->hasKnownValue() ||
|
|
||||||
parent->astOperand2()->hasKnownValue());
|
|
||||||
|
|
||||||
// known result when a operand is 0.
|
// known result when a operand is 0.
|
||||||
if (Token::Match(parent, "[&*]") && value.isKnown() && value.isIntValue() && value.intvalue==0) {
|
if (Token::Match(parent, "[&*]") && value.isKnown() && value.isIntValue() && value.intvalue==0) {
|
||||||
|
|
Loading…
Reference in New Issue