comment
This commit is contained in:
parent
1a4e3dcc44
commit
3273f964c8
|
@ -22,7 +22,6 @@
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
#include "checkpostfixoperator.h"
|
#include "checkpostfixoperator.h"
|
||||||
#include <string>
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -63,12 +62,13 @@ void CheckPostfixOperator::postfixOperator()
|
||||||
if(result) {
|
if(result) {
|
||||||
const Token *decltok = Token::findmatch(_tokenizer->tokens(), "%varid%", tok->previous()->varId());
|
const Token *decltok = Token::findmatch(_tokenizer->tokens(), "%varid%", tok->previous()->varId());
|
||||||
if (decltok && Token::Match(decltok->previous(), "iterator|const_iterator|reverse_iterator|const_reverse_iterator")) {
|
if (decltok && Token::Match(decltok->previous(), "iterator|const_iterator|reverse_iterator|const_reverse_iterator")) {
|
||||||
// the variable an iterator
|
// the variable is an iterator
|
||||||
postfixOperatorError(tok);
|
postfixOperatorError(tok);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const std::string classDef = std::string("class ") + std::string(decltok->previous()->strAt(0));
|
const std::string classDef = std::string("class ") + std::string(decltok->previous()->strAt(0));
|
||||||
if (Token::findmatch(_tokenizer->tokens(), classDef.c_str())) {
|
if (Token::findmatch(_tokenizer->tokens(), classDef.c_str())) {
|
||||||
|
// the variable is an instance of class
|
||||||
postfixOperatorError(tok);
|
postfixOperatorError(tok);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue