]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/28996 (ICE with statement forming unused static member function reference)
authorJason Merrill <jason@redhat.com>
Fri, 22 Sep 2006 23:28:13 +0000 (19:28 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 22 Sep 2006 23:28:13 +0000 (19:28 -0400)
        PR c++/28996
        * cvt.c (convert_to_void): Strip COMPONENT_REF to functions.

From-SVN: r117157

gcc/cp/ChangeLog
gcc/cp/cvt.c

index 866b083fbecee36e8cb4fcd6737293f9055928ab..d8e8d1440e7260f4ce49de55e93795dc4b12399e 100644 (file)
@@ -1,3 +1,8 @@
+2006-09-09  Jason Merrill  <jason@redhat.com>
+
+       PR c++/28996
+       * cvt.c (convert_to_void): Strip COMPONENT_REF to functions.
+
 2006-09-09  Jason Merrill  <jason@redhat.com>
 
        PR c++/26957
index 6b9067600a393c2e42f15f92896f316a344a502c..1f4b924e53b513e4887286cc4cd6e45f0f98c4dc 100644 (file)
@@ -898,9 +898,13 @@ convert_to_void (tree expr, const char *implicit)
        expr = void_zero_node;
       }
     else if (implicit && probe == expr && is_overloaded_fn (probe))
-      /* Only warn when there is no &.  */
-      warning ("%s is a reference, not call, to function %qE",
-                 implicit, expr);
+      {
+       /* Only warn when there is no &.  */
+       warning ("%s is a reference, not call, to function %qE",
+                implicit, expr);
+       if (TREE_CODE (expr) == COMPONENT_REF)
+         expr = TREE_OPERAND (expr, 0);
+      }
   }
   
   if (expr != error_mark_node && !VOID_TYPE_P (TREE_TYPE (expr)))