
MSVC has a `try-except` statement. This statement could containt a `__leave` keyword, which is similar to `goto` to the end of the try block. The semantic of this keyword is not implemented. We should at least parse such code without crashing. https://docs.microsoft.com/en-us/cpp/cpp/try-except-statement?view=msvc-160 Patch By: AbbasSabra! Reviewed By: steakhal Differential Revision: https://reviews.llvm.org/D102280
14 lines
422 B
C++
14 lines
422 B
C++
// 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
|
|
clang_analyzer_warnIfReached(); // no-warning
|
|
} __except (filter()) {
|
|
}
|
|
clang_analyzer_warnIfReached(); // expected-warning{{REACHABLE}}
|
|
}
|