diff --git a/cli/cmdlineparser.cpp b/cli/cmdlineparser.cpp index 5fbc7bf7f..d991e61fd 100644 --- a/cli/cmdlineparser.cpp +++ b/cli/cmdlineparser.cpp @@ -257,7 +257,7 @@ bool CmdLineParser::parseFromArgs(int argc, const char* const argv[]) else if (std::strncmp(argv[i], "--cppcheck-build-dir=", 21) == 0) { mSettings->buildDir = Path::fromNativeSeparators(argv[i] + 21); if (endsWith(mSettings->buildDir, '/')) - mSettings->buildDir.erase(mSettings->buildDir.size() - 1U); + mSettings->buildDir.pop_back(); } // Show --debug output after the first simplifications diff --git a/externals/simplecpp/simplecpp.cpp b/externals/simplecpp/simplecpp.cpp index 52ba3ea6f..2cb65f052 100644 --- a/externals/simplecpp/simplecpp.cpp +++ b/externals/simplecpp/simplecpp.cpp @@ -561,7 +561,7 @@ void simplecpp::TokenList::readfile(std::istream &istr, const std::string &filen portabilityBackslash(outputList, files, location); if (currentToken[currentToken.size() - 1U] == '\\') { ++multiline; - currentToken.erase(currentToken.size() - 1U); + currentToken.pop_back(); } else { ungetChar(istr, bom); } @@ -606,7 +606,7 @@ void simplecpp::TokenList::readfile(std::istream &istr, const std::string &filen if (ch == '\"' && !prefix.empty() && *cback()->str().rbegin() == 'R') { std::string delim; currentToken = ch; - prefix.resize(prefix.size() - 1); + prefix.pop_back(); ch = readChar(istr,bom); while (istr.good() && ch != '(' && ch != '\n') { delim += ch; @@ -1147,7 +1147,7 @@ std::string simplecpp::TokenList::readUntil(std::istream &istr, const Location & do { next = readChar(istr, bom); if (next == '\r' || next == '\n') { - ret.erase(ret.size()-1U); + ret.pop_back(); backslash = (next == '\r'); update_ch = false; } else if (next == '\\') @@ -2176,7 +2176,7 @@ namespace simplecpp { // remove trailing dot if path ends with "/." if (endsWith(path,"/.")) - path.erase(path.size()-1); + path.pop_back(); // simplify ".." pos = 1; // don't simplify ".." if path starts with that diff --git a/lib/token.cpp b/lib/token.cpp index e9673f196..7a3f6d797 100644 --- a/lib/token.cpp +++ b/lib/token.cpp @@ -175,7 +175,7 @@ bool Token::isUpperCaseName() const void Token::concatStr(std::string const& b) { - mStr.erase(mStr.length() - 1); + mStr.pop_back(); mStr.append(getStringLiteral(b) + "\""); if (isCChar() && isStringLiteral(b) && b[0] != '"') {