From: jakub Date: Wed, 16 Oct 2019 22:19:13 +0000 (+0000) Subject: * decl.c (cxx_maybe_build_cleanup): When clearing location of cleanup, X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b1637ad18603f2b2b29949c9f3517c628f90fd9a;p=thirdparty%2Fgcc.git * decl.c (cxx_maybe_build_cleanup): When clearing location of cleanup, if cleanup is a nop, clear location of its operand too. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@277084 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ecaf312639bf..6c1e6b46377b 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2019-10-16 Jakub Jelinek + + * decl.c (cxx_maybe_build_cleanup): When clearing location of cleanup, + if cleanup is a nop, clear location of its operand too. + 2019-10-15 Nathan Sidwell * class.c (build_clones): Break out of clone_function_decl. Just diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a9ff4275a670..5e510c91aa30 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -16864,6 +16864,8 @@ cxx_maybe_build_cleanup (tree decl, tsubst_flags_t complain) the end of the block. So let's unset the location of the destructor call instead. */ protected_set_expr_location (cleanup, UNKNOWN_LOCATION); + if (cleanup && CONVERT_EXPR_P (cleanup)) + protected_set_expr_location (TREE_OPERAND (cleanup, 0), UNKNOWN_LOCATION); if (cleanup && DECL_P (decl)