diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2021-12-09 13:54:39 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2021-12-09 23:02:37 +0000 |
commit | a1ca039fc0fe934ef36c25d8284e6e116bcaffa7 (patch) | |
tree | 0130f298f5e76dbc46ce7501c8e099dddf7a709d /libphobos/src/std/algorithm | |
parent | a219139e986a4200a9105d7c1fa63735d2945994 (diff) | |
download | gcc-a1ca039fc0fe934ef36c25d8284e6e116bcaffa7.zip gcc-a1ca039fc0fe934ef36c25d8284e6e116bcaffa7.tar.gz gcc-a1ca039fc0fe934ef36c25d8284e6e116bcaffa7.tar.bz2 |
libstdc++: Fix std::exception_ptr regressions [PR103630]
This restores support for std::make_exception_ptr<E&> and for using
std::exception_ptr in C++98.
Because the new non-throwing implementation needs to use std::decay to
handle references the original throwing implementation is used for
C++98.
We also need to change the typeid expression so it doesn't yield the
dynamic type when the function parameter is a reference to a polymorphic
type. Otherwise the new exception object could be caught by any handler
matching the dynamic type, even though the actual exception object is
only a copy of the base class, sliced to the static type.
libstdc++-v3/ChangeLog:
PR libstdc++/103630
* libsupc++/exception_ptr.h (exception_ptr): Fix exception
specifications on inline definitions.
(make_exception_ptr): Decay the template parameter. Use typeid
of the static type.
* testsuite/18_support/exception_ptr/103630.cc: New test.
Diffstat (limited to 'libphobos/src/std/algorithm')
0 files changed, 0 insertions, 0 deletions