OSDN Git Service

PR c++/52746
[pf3gnuchains/gcc-fork.git] / gcc / cp / typeck.c
index ba5ae46..8a0c75b 100644 (file)
@@ -2410,6 +2410,11 @@ lookup_destructor (tree object, tree scope, tree dtor_name)
                        tf_warning_or_error);
   expr = (adjust_result_of_qualified_name_lookup
          (expr, dtor_type, object_type));
+  if (scope == NULL_TREE)
+    /* We need to call adjust_result_of_qualified_name_lookup in case the
+       destructor names a base class, but we unset BASELINK_QUALIFIED_P so
+       that we still get virtual function binding.  */
+    BASELINK_QUALIFIED_P (expr) = false;
   return expr;
 }