--- gcc/cp/class.c.jj	2010-06-17 08:17:04.000000000 +0200
+++ gcc/cp/class.c	2010-06-28 10:44:33.000000000 +0200
@@ -283,6 +283,8 @@ build_base_path (enum tree_code code,
   if (!want_pointer)
     /* This must happen before the call to save_expr.  */
     expr = cp_build_unary_op (ADDR_EXPR, expr, 0, tf_warning_or_error);
+  else
+    mark_rvalue_use (expr);
 
   offset = BINFO_OFFSET (binfo);
   fixed_type_p = resolves_to_fixed_type_p (expr, &nonnull);
--- gcc/testsuite/g++.dg/warn/Wunused-var-14.C.jj	2010-06-28 10:50:59.000000000 +0200
+++ gcc/testsuite/g++.dg/warn/Wunused-var-14.C	2010-06-28 10:51:20.000000000 +0200
@@ -0,0 +1,17 @@
+// PR c++/44682
+// { dg-do compile }
+// { dg-options "-Wunused" }
+
+struct S { virtual ~S () {} };
+struct T { virtual ~T () {} };
+struct U : S, T {};
+
+void f (U &);
+
+void
+g (void *v)
+{
+  T *t = static_cast <T *> (v);
+  U *u = static_cast <U *> (t);
+  f (*u);
+}
