================
@@ -736,8 +741,13 @@ CIRGenFunction::emitCXXTryStmt(const CXXTryStmt &s,
// The currently handled exception is rethrown if control
// reaches the end of a handler of the function-try-block of a
// constructor or destructor.
-
- // TODO(cir): Handle implicit rethrow?
+ //
+ // It is important that we only do this on fallthrough and not on
+ // return. Note that it's illegal to put a return in a
+ // constructor function-try-block's catch handler (p14), so this
+ // really only applies to destructors.
+ if (doImplicitRethrow && haveInsertPoint())
----------------
erichkeane wrote:
That seems reasonable to me. I've included that as-is and am using it. I
wonder if `hasInsertPoint` should be removed at one point from CIRGen...
https://github.com/llvm/llvm-project/pull/229436
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits