diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0d91aed04b0a96613e2dfbf62e878f9dd423acac..e4186b9d86405d06701ba44824249270c5bef198 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2006-06-01  Andrew Pinski  <pinskia@physics.uc.edu>
+
+	PR c++/26740
+	* typeck.c (build_unary_op): Mark the function as being used.
+
 2006-06-01  Alexandre Oliva  <aoliva@redhat.com>
 
 	PR c++/26660
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 975bfd3e0555e32cee51404f5516f003e484a1f3..5861f233c0f8369acc6de1c42fb7b35c5e414e7f 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -4245,6 +4245,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
 	     and the created OFFSET_REF.  */
 	  tree base = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (arg, 0)));
 	  tree fn = get_first_fn (TREE_OPERAND (arg, 1));
+	  mark_used (fn);
 
 	  if (! flag_ms_extensions)
 	    {