Skip to content

Commit e915796

Browse files
author
Tom James
committed
Remove unused variables
1 parent bd53bcc commit e915796

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

clang-tools-extra/clang-tidy/bugprone/MethodHidingCheck.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,10 @@ void MethodHidingCheck::check(const MatchFinder::MatchResult &Result) {
130130
llvm_unreachable("Required binding not found");
131131
}
132132

133-
auto const MethodName = ShadowingMethod->getNameInfo().getAsString();
134-
auto const DerivedClassName = DerivedClass->getNameAsString();
135-
const std::string BaseClassName = BaseMethod->getParent()->getNameAsString();
136-
137-
std::string Message;
138-
llvm::raw_string_ostream StringStream(Message);
139-
StringStream << "'" << ShadowingMethod->getQualifiedNameAsString()
140-
<< "' hides same method in '" << BaseClassName << "'";
141-
diag(ShadowingMethod->getBeginLoc(), Message);
133+
diag(ShadowingMethod->getBeginLoc(),
134+
"'" + ShadowingMethod->getQualifiedNameAsString() +
135+
"' hides same method in '" +
136+
BaseMethod->getParent()->getNameAsString() + "'");
142137
diag(BaseMethod->getBeginLoc(), "previous definition is here",
143138
DiagnosticIDs::Note);
144139
}

0 commit comments

Comments
 (0)