File tree Expand file tree Collapse file tree 5 files changed +201
-107
lines changed Expand file tree Collapse file tree 5 files changed +201
-107
lines changed Original file line number Diff line number Diff line change @@ -81,26 +81,24 @@ void ExceptionEscapeCheck::check(const MatchFinder::MatchResult &Result) {
8181 const utils::ExceptionAnalyzer::ExceptionInfo Info =
8282 Tracer.analyze (MatchedDecl);
8383
84- if (Info.getBehaviour () != utils::ExceptionAnalyzer::State::Throwing) {
84+ if (Info.getBehaviour () != utils::ExceptionAnalyzer::State::Throwing)
8585 return ;
86- }
8786
8887 diag (MatchedDecl->getLocation (), " an exception may be thrown in function "
8988 " %0 which should not throw exceptions" )
9089 << MatchedDecl;
9190
92- const utils::ExceptionAnalyzer::ExceptionInfo::ThrowInfo ThrowInfo =
93- Info.getExceptions ().begin ()->getSecond ();
91+ const auto &[ThrowType, ThrowInfo] = *Info.getExceptions ().begin ();
9492
95- if (ThrowInfo.Loc .isInvalid ()) {
93+ if (ThrowInfo.Loc .isInvalid ())
9694 return ;
97- }
9895
9996 const utils::ExceptionAnalyzer::CallStack &Stack = ThrowInfo.Stack ;
10097 diag (ThrowInfo.Loc ,
101- " frame #0: unhandled exception may be thrown in function %0 here" ,
98+ " frame #0: unhandled exception of type %0 may be thrown in function %1 "
99+ " here" ,
102100 DiagnosticIDs::Note)
103- << Stack.back ().first ;
101+ << QualType (ThrowType, 0U ) << Stack.back ().first ;
104102
105103 size_t FrameNo = 1 ;
106104 for (auto CurrIt = ++Stack.rbegin (), PrevIt = Stack.rbegin ();
You can’t perform that action at this time.
0 commit comments