diff --git a/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp b/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp --- a/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp +++ b/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp @@ -349,6 +349,7 @@ HandleBranch(cast(Term)->getCond(), Term, B, Pred); return; + case Stmt::SEHLeaveStmtClass: case Stmt::ContinueStmtClass: case Stmt::BreakStmtClass: case Stmt::GotoStmtClass: diff --git a/clang/test/Analysis/misc-ms-leave.cpp b/clang/test/Analysis/misc-ms-leave.cpp new file mode 100644 --- /dev/null +++ b/clang/test/Analysis/misc-ms-leave.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -triple x86_64-pc-windows-msvc19.11.0 -fms-extensions -verify %s + +void clang_analyzer_warnIfReached(); +int filter(); + +void try_except_leave() { + __try { + __leave; // no-crash + } __except (filter()) { + } + clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}} +}