aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.python/py-pp-cast.py
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-09-24 13:47:56 +0200
committerTom de Vries <tdevries@suse.de>2024-09-24 13:47:56 +0200
commit6078478a9075a3ad3d1370dc540e11425948074c (patch)
tree6973a77602e1485fa16178a37389276097aafd5f /gdb/testsuite/gdb.python/py-pp-cast.py
parentb3926d6ad14413ca64e7828c98823c52d7e74307 (diff)
downloadbinutils-6078478a9075a3ad3d1370dc540e11425948074c.zip
binutils-6078478a9075a3ad3d1370dc540e11425948074c.tar.gz
binutils-6078478a9075a3ad3d1370dc540e11425948074c.tar.bz2
[gdb] Make scope_exit constructor throw
While reviewing "catch (...)" uses I came across: ... scope_exit (EFP &&f) try : m_exit_function ((!std::is_lvalue_reference<EFP>::value && std::is_nothrow_constructible<EF, EFP>::value) ? std::move (f) : f) { } catch (...) { /* "If the initialization of exit_function throws an exception, calls f()." */ f (); } ... and while looking up the origin of the comment here [1] I saw right after: ... throws: Nothing, unless the initialization of exit_function throws ... I think that means that the exception should be rethrown, so fix this by doing so. Tested on aarch64-linux. Approved-By: Tom Tromey <tom@tromey.com> [1] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0052r5.pdf
Diffstat (limited to 'gdb/testsuite/gdb.python/py-pp-cast.py')
0 files changed, 0 insertions, 0 deletions