From 53a3f614250f4e7b440e9932aa92fd03410de10f Mon Sep 17 00:00:00 2001 From: Eric Botcazou Date: Tue, 9 Apr 2019 19:29:17 +0000 Subject: [PATCH] c-ada-spec.c (print_destructor): Deal with deleting destructors. * c-ada-spec.c (print_destructor): Deal with deleting destructors. (dump_ada_declaration) : Likewise. From-SVN: r270239 --- gcc/c-family/ChangeLog | 5 +++++ gcc/c-family/c-ada-spec.c | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index c62395f2acf..2d118f2f73b 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2019-04-09 Eric Botcazou + + * c-ada-spec.c (print_destructor): Deal with deleting destructors. + (dump_ada_declaration) : Likewise. + 2019-04-07 Eric Botcazou * c-ada-spec.c (is_float128): New predicate extracted from... diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index 2ca8bdaeaa3..c85e6060d3e 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -2676,6 +2676,8 @@ print_destructor (pretty_printer *buffer, tree t, tree type) tree decl_name = DECL_NAME (TYPE_NAME (type)); pp_string (buffer, "Delete_"); + if (strncmp (IDENTIFIER_POINTER (DECL_NAME (t)), "__dt_del", 8) == 0) + pp_string (buffer, "And_Free_"); pp_ada_tree_identifier (buffer, decl_name, t, false); } @@ -2946,9 +2948,10 @@ dump_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc) if (DECL_ARTIFICIAL (t)) return 0; - /* Only consider constructors/destructors for complete objects. */ + /* Only consider complete constructors and deleting destructors. */ if (strncmp (IDENTIFIER_POINTER (decl_name), "__ct_comp", 9) != 0 - && strncmp (IDENTIFIER_POINTER (decl_name), "__dt_comp", 9) != 0) + && strncmp (IDENTIFIER_POINTER (decl_name), "__dt_comp", 9) != 0 + && strncmp (IDENTIFIER_POINTER (decl_name), "__dt_del", 8) != 0) return 0; } -- 2.30.2