Fixed two compiler warnings spotted by edward-san (one of them was a real bug)
This commit is contained in:
parent
a9cfe2814a
commit
77927583f4
|
@ -1457,7 +1457,7 @@ bool CheckClass::checkConstFunc(const Scope *scope, const Function *func)
|
||||||
const Variable *var = symbolDatabase->getVariableFromVarId(tok1->varId());
|
const Variable *var = symbolDatabase->getVariableFromVarId(tok1->varId());
|
||||||
|
|
||||||
if (var && Token::simpleMatch(var->typeStartToken(), "std ::") // assume all std::*::size() and std::*::empty() are const
|
if (var && Token::simpleMatch(var->typeStartToken(), "std ::") // assume all std::*::size() and std::*::empty() are const
|
||||||
&& Token::Match(tok1->tokAt(2), "size|empty|cend|crend|cbegin|crbegin|max_size|length|count|capacity|get_allocator|c_str|str ( )") || Token::Match(tok1->tokAt(2), "rfind|copy"))
|
&& (Token::Match(tok1->tokAt(2), "size|empty|cend|crend|cbegin|crbegin|max_size|length|count|capacity|get_allocator|c_str|str ( )") || Token::Match(tok1->tokAt(2), "rfind|copy")))
|
||||||
tok1 = tok1->next();
|
tok1 = tok1->next();
|
||||||
else if (var) { // Check if the function is const
|
else if (var) { // Check if the function is const
|
||||||
const Scope* type = var->type();
|
const Scope* type = var->type();
|
||||||
|
|
|
@ -835,7 +835,7 @@ void Variable::evaluate()
|
||||||
if (_start)
|
if (_start)
|
||||||
setFlag(fIsClass, !_start->isStandardType() && !isPointer() && !isReference());
|
setFlag(fIsClass, !_start->isStandardType() && !isPointer() && !isReference());
|
||||||
if (_access == Argument && _name) {
|
if (_access == Argument && _name) {
|
||||||
const Token* tok = _name->next();
|
tok = _name->next();
|
||||||
while (tok->str() == "[")
|
while (tok->str() == "[")
|
||||||
tok = tok->link();
|
tok = tok->link();
|
||||||
setFlag(fHasDefault, tok->str() == "=");
|
setFlag(fHasDefault, tok->str() == "=");
|
||||||
|
|
Loading…
Reference in New Issue