[clang] [WinEH] Fix crash, object unwinding in the except block (PR #172287)

via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 19 05:06:28 PST 2025


================
@@ -4515,6 +4515,57 @@ void Sema::DiagnoseExceptionUse(SourceLocation Loc, bool IsTry) {
     targetDiag(Loc, diag::err_exceptions_disabled) << (IsTry ? "try" : "throw");
 }
 
+// Walk the statement subtree and return the first statement that
+// contains a non-trivial C++ object that would require destruction at
+// scope exit, or nullptr if none was found.
+static const Stmt *findNonTrivialObject(Sema &S, const Stmt *Node) {
----------------
GkvJwa wrote:

If change here, It seems that only check `IsNormalCleanup == true`, and then a diagnosis can be made.

https://github.com/llvm/llvm-project/pull/172287


More information about the cfe-commits mailing list