Commit 86796d87 authored by Egor Gabov's avatar Egor Gabov

deleted redundant qualifier

deleted redundant qualifier from std::string.
This means: std::string -> string
parent 30d6a2b6
......@@ -878,7 +878,7 @@ string Utils::filenameForLoc(SourceLocation loc, const clang::SourceManager &sm)
if (loc.isMacroID())
loc = sm.getExpansionLoc(loc);
const string filename = static_cast<std::string>(sm.getFilename(loc));
const string filename = static_cast<string>(sm.getFilename(loc));
auto splitted = clazy::splitString(filename, '/');
if (splitted.empty())
return {};
......
......@@ -188,7 +188,7 @@ bool CheckBase::shouldIgnoreFile(SourceLocation loc) const
if (!loc.isValid())
return true;
string filename = static_cast<std::string>(sm().getFilename(loc));
string filename = static_cast<string>(sm().getFilename(loc));
return clazy::any_of(m_filesToIgnore, [filename](const std::string &ignored) {
return clazy::contains(filename, ignored);
......
......@@ -59,7 +59,7 @@ void QEnums::VisitMacroExpands(const Token &MacroNameTok, const SourceRange &ran
// We simply check if :: is present because it's very cumbersome to to check for different classes when dealing with the pre-processor
CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo());
string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo()));
string text = static_cast<string>(Lexer::getSourceText(crange, sm(), lo()));
if (clazy::contains(text, "::"))
return;
}
......
......@@ -274,7 +274,7 @@ void OldStyleConnect::VisitMacroExpands(const Token &macroNameTok, const SourceR
return;
auto charRange = Lexer::getAsCharRange(range, sm(), lo());
const string text = static_cast<std::string>(Lexer::getSourceText(charRange, sm(), lo()));
const string text = static_cast<string>(Lexer::getSourceText(charRange, sm(), lo()));
static regex rx(R"(Q_PRIVATE_SLOT\s*\((.*)\s*,\s*.*\s+(.*)\(.*)");
smatch match;
......@@ -293,7 +293,7 @@ string OldStyleConnect::signalOrSlotNameFromMacro(SourceLocation macroLoc)
CharSourceRange expansionRange = clazy::getImmediateExpansionRange(macroLoc, sm());
SourceRange range = SourceRange(expansionRange.getBegin(), expansionRange.getEnd());
auto charRange = Lexer::getAsCharRange(range, sm(), lo());
const string text = static_cast<std::string>(Lexer::getSourceText(charRange, sm(), lo()));
const string text = static_cast<string>(Lexer::getSourceText(charRange, sm(), lo()));
static regex rx(R"(\s*(SIGNAL|SLOT)\s*\(\s*(.+)\s*\(.*)");
......@@ -315,7 +315,7 @@ bool OldStyleConnect::isSignalOrSlot(SourceLocation loc, string &macroName) cons
if (!loc.isMacroID() || loc.isInvalid())
return false;
macroName = static_cast<std::string>(Lexer::getImmediateMacroName(loc, sm(), lo()));
macroName = static_cast<string>(Lexer::getImmediateMacroName(loc, sm(), lo()));
return macroName == "SIGNAL" || macroName == "SLOT";
}
......
......@@ -140,7 +140,7 @@ void RuleOfThree::VisitDecl(clang::Decl *decl)
const string className = record->getNameAsString();
const string classQualifiedName = record->getQualifiedNameAsString();
const string filename = static_cast<std::string>(sm().getFilename(recordStart));
const string filename = static_cast<string>(sm().getFilename(recordStart));
if (clazy::endsWith(className, "Private") && clazy::endsWithAny(filename, { ".cpp", ".cxx", "_p.h" }))
return; // Lots of RAII classes fall into this category. And even Private (d-pointer) classes, warning in that case would just be noise
......
......@@ -237,7 +237,7 @@ void QPropertyTypeMismatch::VisitMacroExpands(const clang::Token &MacroNameTok,
CharSourceRange crange = Lexer::getAsCharRange(range, sm(), lo());
string text = static_cast<std::string>(Lexer::getSourceText(crange, sm(), lo()));
string text = static_cast<string>(Lexer::getSourceText(crange, sm(), lo()));
if (!text.empty() && text.back() == ')')
text.pop_back();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment