aboutsummaryrefslogtreecommitdiff
path: root/libcpp/errors.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2020-01-19 09:14:54 -0500
committerJason Merrill <jason@redhat.com>2020-01-19 13:56:22 -0500
commitbcfc2227c556f2801a657ce3007374732baa8333 (patch)
treedc5c76be5ccee189500336763b3b157b7942ac47 /libcpp/errors.c
parent303484a73541ea7f41dff0238157924e49c255ff (diff)
downloadgcc-bcfc2227c556f2801a657ce3007374732baa8333.zip
gcc-bcfc2227c556f2801a657ce3007374732baa8333.tar.gz
gcc-bcfc2227c556f2801a657ce3007374732baa8333.tar.bz2
PR c++/33799 - destroy return value, take 2.
This patch differs from the reverted patch for 33799 in that it adds the CLEANUP_STMT for the return value at the end of the function, and only if we've seen a cleanup that might throw, so it should not affect most C++11 code. * cp-tree.h (current_retval_sentinel): New macro. (struct language_function): Add throwing_cleanup bitfield. * decl.c (cxx_maybe_build_cleanup): Set it. * except.c (maybe_set_retval_sentinel) (maybe_splice_retval_cleanup): New functions. * parser.c (cp_parser_compound_statement): Call maybe_splice_retval_cleanup. * typeck.c (check_return_expr): Call maybe_set_retval_sentinel.
Diffstat (limited to 'libcpp/errors.c')
0 files changed, 0 insertions, 0 deletions