Skip to content

Commit 3f9e2e1

Browse files
committed
[NFC][clang-tidy] fix typo in readability-else-after-return
1 parent d70d326 commit 3f9e2e1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

clang-tools-extra/clang-tidy/readability/ElseAfterReturnCheck.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static StringRef getControlFlowString(const Stmt &Stmt) {
231231
return "break";
232232
if (isa<CXXThrowExpr>(Stmt))
233233
return "throw";
234-
llvm_unreachable("Unknown control flow interruptor");
234+
llvm_unreachable("Unknown control flow interrupter");
235235
}
236236

237237
void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) {
@@ -247,12 +247,12 @@ void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) {
247247
return;
248248

249249
bool IsLastInScope = OuterScope->body_back() == If;
250-
StringRef ControlFlowInterruptor = getControlFlowString(*Interrupt);
250+
const StringRef ControlFlowInterrupter = getControlFlowString(*Interrupt);
251251

252252
if (!IsLastInScope && containsDeclInScope(Else)) {
253253
if (WarnOnUnfixable) {
254254
// Warn, but don't attempt an autofix.
255-
diag(ElseLoc, WarningMessage) << ControlFlowInterruptor;
255+
diag(ElseLoc, WarningMessage) << ControlFlowInterrupter;
256256
}
257257
return;
258258
}
@@ -264,7 +264,7 @@ void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) {
264264
// If the if statement is the last statement of its enclosing statements
265265
// scope, we can pull the decl out of the if statement.
266266
DiagnosticBuilder Diag = diag(ElseLoc, WarningMessage)
267-
<< ControlFlowInterruptor
267+
<< ControlFlowInterrupter
268268
<< SourceRange(ElseLoc);
269269
if (checkInitDeclUsageInElse(If) != nullptr) {
270270
Diag << tooling::fixit::createReplacement(
@@ -288,7 +288,7 @@ void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) {
288288
removeElseAndBrackets(Diag, *Result.Context, Else, ElseLoc);
289289
} else if (WarnOnUnfixable) {
290290
// Warn, but don't attempt an autofix.
291-
diag(ElseLoc, WarningMessage) << ControlFlowInterruptor;
291+
diag(ElseLoc, WarningMessage) << ControlFlowInterrupter;
292292
}
293293
return;
294294
}
@@ -300,7 +300,7 @@ void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) {
300300
// If the if statement is the last statement of its enclosing statements
301301
// scope, we can pull the decl out of the if statement.
302302
DiagnosticBuilder Diag = diag(ElseLoc, WarningMessage)
303-
<< ControlFlowInterruptor
303+
<< ControlFlowInterrupter
304304
<< SourceRange(ElseLoc);
305305
Diag << tooling::fixit::createReplacement(
306306
SourceRange(If->getIfLoc()),
@@ -312,13 +312,13 @@ void ElseAfterReturnCheck::check(const MatchFinder::MatchResult &Result) {
312312
removeElseAndBrackets(Diag, *Result.Context, Else, ElseLoc);
313313
} else if (WarnOnUnfixable) {
314314
// Warn, but don't attempt an autofix.
315-
diag(ElseLoc, WarningMessage) << ControlFlowInterruptor;
315+
diag(ElseLoc, WarningMessage) << ControlFlowInterrupter;
316316
}
317317
return;
318318
}
319319

320320
DiagnosticBuilder Diag = diag(ElseLoc, WarningMessage)
321-
<< ControlFlowInterruptor << SourceRange(ElseLoc);
321+
<< ControlFlowInterrupter << SourceRange(ElseLoc);
322322
removeElseAndBrackets(Diag, *Result.Context, Else, ElseLoc);
323323
}
324324

0 commit comments

Comments
 (0)