[PATCH] D42092: implement C++ dr388 for the Itanium C++ ABI: proper handling of catching exceptions by reference

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 4 16:34:41 PDT 2018


rsmith added a comment.

In https://reviews.llvm.org/D42092#983892, @rjmccall wrote:

> This is definitely something that the personality function should handle.  If we want to do heroic things in the absence of personality function support, we can, but the code should at least be written to be conditional on personality support.


I suppose the question is, do we want to do such heroic things?

Also, we don't have a personality function that can get this right, nor even a concrete design proposed for one. It doesn't seem too hard -- we'd need to extend the EH table to indicate catch-by-reference -- but there's nothing for this to be made conditional on right now. I can easily add a CodeGenOption that turns this all off, if you'd like.

> If we can rev the personality function, we should also fix the longstanding problem with references to pointers to classes.

Which issue is that? (And does this patch fail to address it? It should prevent catching `Derived*` by (non-const) `Base *&` while still allowing catch by `Base *const&`, if that's the issue you're referring to.)


Repository:
  rC Clang

https://reviews.llvm.org/D42092





More information about the cfe-commits mailing list