Pointers will now always be caught by-value.
The workaround was originally added in commit
5add20cefac7d1b06e7892ce0d97767a23db4e1a. (Note, that commit also made
the codegen for catching a pointer by reference work _at all_. I am
not reverting that part of it.)
The intent was to enable catch (int*&ptr) { ptr = 0; throw; }
to correctly propagate the new value of ptr to a higher catch block.
Unfortunately, the implementation was always rather suspect, as it
hardcoded byte offsets of EH structs, and accessed data directly,
assuming it knew the layout. Unfortunately, as recently reported, this
is now known to break std::rethrow_exception, as that doesn't use the
expected layout.
Because it does not appear possible to solve the issue in a principled
way without modifying the Itanium ABI, this change simply removes the
hack.
While we therefore fix the bug referenced, this also introduces the
bug whereby modifying a pointer caught by reference is no longer
visible to other catch blocks.
Introduces FIXME file new bug and link here FIXME
Fixes https://github.com/llvm/llvm-project/issues/55340