[clang] [clang][Sema] Diagnose exceptions only in non-dependent context in discarded `try/catch/throw` blocks (PR #139859)

Rajveer Singh Bharadwaj via cfe-commits cfe-commits at lists.llvm.org
Fri May 16 05:08:45 PDT 2025


Rajveer100 wrote:

Moving the checks does work for these limited cases, but now that we don't have them there, one of the old tests now doesn't show up the diagnosis:

```c++
void f() {
  throw;
}

void g() {
  try {
    f();
  } catch (...) {
  }
}
```

Since there is a separate call:

```c++
return Actions.ActOnCXXTryBlock(TryLoc, TryBlock.get(), Handlers);
```

and debugging under lldb breakpoints don't reach (i.e exit) the transform calls.

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


More information about the cfe-commits mailing list