modimo added a comment.

In D108905#2973099 <https://reviews.llvm.org/D108905#2973099>, @rjmccall wrote:

> Yeah, I think this is the most natural interpretation of the current 
> standard.  But that would be a very unfortunate rule, because people who 
> write `catch (...) {}` do reasonably expect that that code will never throw.  
>  In fact, it would be quite difficult — perhaps impossible — to write code 
> that actually swallowed all exceptions: even `try { try { foo() } catch(...) 
> {} } catch (...) {}` wouldn't work, because you could throw an exception 
> whose destructor throws an exception whose destructor throws an exception ad 
> infinitum.

Yeah it's not great and also something that practically will never happen. I 
think terminate guards are the only thing that really swallows all exceptions 
except here you can't guard the catch variable destructor unless you want to 
change up and depend on library implementation. My immediate thought is 
something like `catch(...) noexcept {}` to express this but it's a solution to 
a problem that really shouldn't exist.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108905/new/

https://reviews.llvm.org/D108905

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to