diff --git a/clang-tools-extra/clang-tidy/.clang-tidy b/clang-tools-extra/clang-tidy/.clang-tidy index 0c2f34b529016..24f7d9ffdcf50 100644 --- a/clang-tools-extra/clang-tidy/.clang-tidy +++ b/clang-tools-extra/clang-tidy/.clang-tidy @@ -7,6 +7,7 @@ Checks: > -bugprone-narrowing-conversions, -bugprone-unchecked-optional-access, -bugprone-unused-return-value, + misc-const-correctness, modernize-*, -modernize-avoid-c-arrays, -modernize-pass-by-value, diff --git a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp index 8ead26407ee5d..ac0adc498e2cc 100644 --- a/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp +++ b/clang-tools-extra/clang-tidy/utils/ExceptionAnalyzer.cpp @@ -601,13 +601,14 @@ ExceptionAnalyzer::throwsException(const Stmt *St, // whether the call itself throws. if (const auto *Call = dyn_cast(St)) { if (const FunctionDecl *Func = Call->getDirectCallee()) { - ExceptionInfo Excs = + const ExceptionInfo Excs = throwsException(Func, Caught, CallStack, Call->getBeginLoc()); Results.merge(Excs); } } else if (const auto *Construct = dyn_cast(St)) { - ExceptionInfo Excs = throwsException(Construct->getConstructor(), Caught, - CallStack, Construct->getBeginLoc()); + const ExceptionInfo Excs = + throwsException(Construct->getConstructor(), Caught, CallStack, + Construct->getBeginLoc()); Results.merge(Excs); } }