https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88699

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dmalcolm at gcc dot gnu.org

--- Comment #5 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
The crash occurs during this assertion in add_method:

1136      /* A class should never have more than one destructor.  */
1137      gcc_assert (!current_fns || !DECL_DESTRUCTOR_P (method));

when method is a using_decl whereas DECL_DESTRUCTOR_P presumably wants a
function_decl.

This patch stops the crash for comment #4 (though maybe it's papering over the
problem):

diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index e7897f2..e8773c2 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -1134,7 +1134,7 @@ add_method (tree type, tree method, bool via_using)
     }

   /* A class should never have more than one destructor.  */
-  gcc_assert (!current_fns || !DECL_DESTRUCTOR_P (method));
+  gcc_assert (!current_fns || via_using || !DECL_DESTRUCTOR_P (method));

   current_fns = ovl_insert (method, current_fns, via_using);

Reply via email to