Skip to content

Commit

Permalink
More fixes of implicit std::string conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikael Holmén committed Jan 29, 2020
1 parent 323bfde commit 2103e08
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions clang-tools-extra/clang-doc/HTMLGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ genStylesheetsHTML(StringRef InfoPath, const ClangDocContext &CDCtx) {
llvm::sys::path::filename(FilePath));
// Paths in HTML must be in posix-style
llvm::sys::path::native(StylesheetPath, llvm::sys::path::Style::posix);
LinkNode->Attributes.emplace_back("href", StylesheetPath.str());
LinkNode->Attributes.emplace_back("href", std::string(StylesheetPath.str()));
Out.emplace_back(std::move(LinkNode));
}
return Out;
Expand All @@ -293,7 +293,7 @@ genJsScriptsHTML(StringRef InfoPath, const ClangDocContext &CDCtx) {
llvm::sys::path::append(ScriptPath, llvm::sys::path::filename(FilePath));
// Paths in HTML must be in posix-style
llvm::sys::path::native(ScriptPath, llvm::sys::path::Style::posix);
ScriptNode->Attributes.emplace_back("src", ScriptPath.str());
ScriptNode->Attributes.emplace_back("src", std::string(ScriptPath.str()));
Out.emplace_back(std::move(ScriptNode));
}
return Out;
Expand Down Expand Up @@ -422,7 +422,7 @@ genReferencesBlock(const std::vector<Reference> &References,

std::vector<std::unique_ptr<TagNode>> Out;
Out.emplace_back(std::make_unique<TagNode>(HTMLTag::TAG_H2, Title));
Out.back()->Attributes.emplace_back("id", Title);
Out.back()->Attributes.emplace_back("id", std::string(Title));
Out.emplace_back(std::make_unique<TagNode>(HTMLTag::TAG_UL));
auto &ULBody = Out.back();
for (const auto &R : References) {
Expand Down Expand Up @@ -454,7 +454,7 @@ writeFileDefinition(const Location &L,
Node->Children.emplace_back(std::make_unique<TextNode>(" of file "));
auto LocFileNode = std::make_unique<TagNode>(
HTMLTag::TAG_A, llvm::sys::path::filename(FileURL));
LocFileNode->Attributes.emplace_back("href", FileURL.str());
LocFileNode->Attributes.emplace_back("href", std::string(FileURL.str()));
Node->Children.emplace_back(std::move(LocFileNode));
return Node;
}
Expand Down Expand Up @@ -502,7 +502,7 @@ static std::unique_ptr<TagNode> genInfoFileMainNode(

auto LeftSidebarNode = std::make_unique<TagNode>(HTMLTag::TAG_DIV);
LeftSidebarNode->Attributes.emplace_back("id", "sidebar-left");
LeftSidebarNode->Attributes.emplace_back("path", InfoPath);
LeftSidebarNode->Attributes.emplace_back("path", std::string(InfoPath));
LeftSidebarNode->Attributes.emplace_back(
"class", "col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left");

Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clang-tidy/ClangTidy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ static CheckersList getAnalyzerCheckersAndPackages(ClangTidyContext &Context,

if (CheckName.startswith("core") ||
Context.isCheckEnabled(ClangTidyCheckName)) {
List.emplace_back(CheckName, true);
List.emplace_back(std::string(CheckName), true);
}
}
return List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void SpecialMemberFunctionsCheck::check(
if (!MatchedDecl)
return;

ClassDefId ID(MatchedDecl->getLocation(), MatchedDecl->getName());
ClassDefId ID(MatchedDecl->getLocation(), std::string(MatchedDecl->getName()));

auto StoreMember = [this, &ID](SpecialMemberFunctionKind Kind) {
llvm::SmallVectorImpl<SpecialMemberFunctionKind> &Members =
Expand Down
4 changes: 2 additions & 2 deletions clang-tools-extra/clang-tidy/utils/RenamerClangTidyCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ void RenamerClangTidyCheck::checkMacro(SourceManager &SourceMgr,
return;
FailureInfo &Info = *MaybeFailure;
StringRef Name = MacroNameTok.getIdentifierInfo()->getName();
NamingCheckId ID(MI->getDefinitionLoc(), Name);
NamingCheckId ID(MI->getDefinitionLoc(), std::string(Name));
NamingCheckFailure &Failure = NamingCheckFailures[ID];
SourceRange Range(MacroNameTok.getLocation(), MacroNameTok.getEndLoc());

Expand All @@ -351,7 +351,7 @@ void RenamerClangTidyCheck::checkMacro(SourceManager &SourceMgr,
void RenamerClangTidyCheck::expandMacro(const Token &MacroNameTok,
const MacroInfo *MI) {
StringRef Name = MacroNameTok.getIdentifierInfo()->getName();
NamingCheckId ID(MI->getDefinitionLoc(), Name);
NamingCheckId ID(MI->getDefinitionLoc(), std::string(Name));

auto Failure = NamingCheckFailures.find(ID);
if (Failure == NamingCheckFailures.end())
Expand Down

0 comments on commit 2103e08

Please sign in to comment.