diff options
author | Jason Merrill <jason@redhat.com> | 2006-09-09 18:26:53 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2006-09-09 18:26:53 -0400 |
commit | 05f8c2d5f6832f5f93f0e397657fad131efafacb (patch) | |
tree | 7cc7ed36c92d1fd1989dc8467b0bf86009fd70f8 /gcc/cp/cvt.c | |
parent | 8b649f3f12cb1903ac9a66028d6e7c3673a42e6f (diff) | |
download | gcc-05f8c2d5f6832f5f93f0e397657fad131efafacb.tar.gz |
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
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 10 |
1 files changed, 7 insertions, 3 deletions
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))) |