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

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Probably can be fixed with just

--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -5702,6 +5702,13 @@ lookup_using_decl (tree scope, name_lookup &lookup)

   if (TREE_CODE (scope) == NAMESPACE_DECL)
     {
+      /* You cannot using-decl a destructor.  */
+      if (TREE_CODE (lookup.name) == BIT_NOT_EXPR)
+   {
+     error ("using-declaration cannot name a destructor");
+     return NULL_TREE;
+   }
+
       /* Naming a namespace member.  */
       qualified_namespace_lookup (scope, &lookup);

Reply via email to