================
@@ -2815,6 +2815,30 @@ static bool neverReturns(const CFGBlock *B) {
if (isa<CXXThrowExpr>(S->getStmt()))
return true;
}
+
+ // If B constructed a temporary whose destructor is noreturn, control
entering
+ // the decision block will always branch to the non-returning destructor.
+ if (B->succ_size() == 1) {
+ if (const CFGBlock *Succ = *B->succ_begin()) {
+ if (Succ->getTerminator().isTemporaryDtorsBranch() &&
+ Succ->succ_size() == 2) {
----------------
aaronpuchert wrote:
Couldn't there be other branches between the branch guarding the constructor
and the temporary destructor branch? Maybe a better way would be to scan the
block for `CXXTemporaryObjectExpr` with a type that has a `noreturn` destructor?
https://github.com/llvm/llvm-project/pull/215691
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits