[clang] [LifetimeSafety] Fix crash on ternary operator when one of the expressions is `throw` (PR #190345)

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 5 01:09:01 PDT 2026


Xazax-hun wrote:

Oh interesting. There is an API called `hasNoReturnElement` on the CfgBlock, so we could alternatively use that one.

That being said, it does not solve the `throw` case. It would definitely be great if the CFG was more faithful for exceptions but I am not sure how big of a project would it be to fix this aspect of our CFG. So I am fine with the original approach and maybe we can add a comment to rely more on the shape of the CFG once this is fixed.

If you feel adventurous, you could give the CFG changes a try in a separate PR. 

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


More information about the cfe-commits mailing list