[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
Wed May 14 01:26:58 PDT 2025


Rajveer100 wrote:

@erichkeane 
As expected the following case is being accepted, which shouldn't happen, let me know what you recommend to diagnose this:

```c++
template <typename T> void foo() {
  try {
  } catch (...) {
  }
  throw 1;
}
void bar2() { foo<int>(); }
```

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


More information about the cfe-commits mailing list