diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-10-17 00:19:13 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-10-17 00:19:13 +0200 |
commit | 606358faa6dbcebb271c1eb9b269a93374fba784 (patch) | |
tree | 55866dc71381db11539b5b330089d26094286b7a /gcc | |
parent | e5b04038edcea3b3f65dec5bd34a0d018b45c1b1 (diff) | |
download | gcc-606358faa6dbcebb271c1eb9b269a93374fba784.zip gcc-606358faa6dbcebb271c1eb9b269a93374fba784.tar.gz gcc-606358faa6dbcebb271c1eb9b269a93374fba784.tar.bz2 |
decl.c (cxx_maybe_build_cleanup): When clearing location of cleanup...
* decl.c (cxx_maybe_build_cleanup): When clearing location of cleanup,
if cleanup is a nop, clear location of its operand too.
From-SVN: r277084
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ecaf312..6c1e6b4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2019-10-16 Jakub Jelinek <jakub@redhat.com> + + * 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 <nathan@acm.org> * class.c (build_clones): Break out of clone_function_decl. Just diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index a9ff427..5e510c9 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) |