[clang] [clang][bytecode] Support compile-time exceptions (PR #189410)

Yanzuo Liu via cfe-commits cfe-commits at lists.llvm.org
Sun Oct 4 07:48:32 PDT 2026


================
@@ -77,6 +77,16 @@ class EvalEmitter : public SourceMapper {
   EvalEmitter(Context &Ctx, Program &P, Expr::EvalStatus &Status,
               InterpStack &Stk, FrameAllocator &FrameAlloc);
 
+  unsigned currentCodeSize() const {
+    llvm_unreachable("Should never be called on EvalEmitter");
----------------
zwuis wrote:

This is reachable. This will be indirectly called by `Sema::CheckForIntOverflow`.

<details>
<summary>Reproducer</summary>

```cpp
int add(int a, int b) { return a + b; }
int f(int x) {
  return add(({
    try { x = 1; } catch (...) { x = 2; }
    x;
  }), 0) + 1;
}
```

</details>

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


More information about the cfe-commits mailing list