Skip to content

Commit 42636a4

Browse files
committed
[clang-tidy] Enable misc-const-correctness rule in clang-tidy codebase
1 parent 070f331 commit 42636a4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

clang-tools-extra/clang-tidy/.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Checks: >
77
-bugprone-narrowing-conversions,
88
-bugprone-unchecked-optional-access,
99
-bugprone-unused-return-value,
10+
misc-const-correctness,
1011
modernize-*,
1112
-modernize-avoid-c-arrays,
1213
-modernize-pass-by-value,

clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,13 +601,14 @@ ExceptionAnalyzer::throwsException(const Stmt *St,
601601
// whether the call itself throws.
602602
if (const auto *Call = dyn_cast<CallExpr>(St)) {
603603
if (const FunctionDecl *Func = Call->getDirectCallee()) {
604-
ExceptionInfo Excs =
604+
const ExceptionInfo Excs =
605605
throwsException(Func, Caught, CallStack, Call->getBeginLoc());
606606
Results.merge(Excs);
607607
}
608608
} else if (const auto *Construct = dyn_cast<CXXConstructExpr>(St)) {
609-
ExceptionInfo Excs = throwsException(Construct->getConstructor(), Caught,
610-
CallStack, Construct->getBeginLoc());
609+
const ExceptionInfo Excs =
610+
throwsException(Construct->getConstructor(), Caught, CallStack,
611+
Construct->getBeginLoc());
611612
Results.merge(Excs);
612613
}
613614
}

0 commit comments

Comments
 (0)