================
@@ -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:
hello, The description above also cannot handle some cases
1. I still plan to use a recursive function for the check(We can make further
improvements later.)
There is similar processing within the coroutine(StmtCanThrow):
https://github.com/llvm/llvm-project/blob/0952ccc712ffc97943fbd0fc3c38a53e7aa875ac/clang/lib/CodeGen/CGCoroutine.cpp#L144-L179
2. The check has been moved inside the EnterSEHTryStmt.
https://github.com/llvm/llvm-project/pull/172287
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits