We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e4ffb48 commit 73231c8Copy full SHA for 73231c8
clang-tools-extra/clang-tidy/modernize/UseStructuredBindingCheck.cpp
@@ -363,11 +363,10 @@ void UseStructuredBindingCheck::check(const MatchFinder::MatchResult &Result) {
363
if (DS2)
364
Hints.emplace_back(FixItHint::CreateRemoval(DS2->getSourceRange()));
365
366
- std::string ReplacementText = Prefix.str() + " [" +
367
- FirstVar->getNameAsString() + ", " +
368
- SecondVar->getNameAsString() + "]";
369
- if (CFRS)
370
- ReplacementText += " :";
+ std::string ReplacementText =
+ (Twine(Prefix) + " [" + FirstVar->getNameAsString() + ", " +
+ SecondVar->getNameAsString() + "]" + (CFRS ? " :" : ""))
+ .str();
371
diag(DiagLoc, "use structured binding to decompose a pair")
372
<< FixItHint::CreateReplacement(ReplaceRange, ReplacementText) << Hints;
373
};
0 commit comments