From 05f8c2d5f6832f5f93f0e397657fad131efafacb Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 9 Sep 2006 18:26:53 -0400 Subject: re PR c++/28996 (ICE with statement forming unused static member function reference) PR c++/28996 * cvt.c (convert_to_void): Strip COMPONENT_REF to functions. From-SVN: r116800 --- gcc/cp/cvt.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gcc/cp/cvt.c') diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index fea5768f8ae..6f61218b232 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -927,9 +927,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 (0, "%s is a reference, not call, to function %qE", - implicit, expr); + { + /* Only warn when there is no &. */ + warning (0, "%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))) -- cgit v1.2.1