aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2006-09-06 13:06:00 -0400
committerJason Merrill <jason@gcc.gnu.org>2006-09-06 13:06:00 -0400
commitccbe00a43acc28143d9c37f45221d8467a093984 (patch)
tree5aec6c4a3744887da7a7770ae253757125a43453 /gcc/cp/tree.c
parent16ceb301d3e670045d6140143be7998ff67d9c18 (diff)
downloadgcc-ccbe00a43acc28143d9c37f45221d8467a093984.zip
gcc-ccbe00a43acc28143d9c37f45221d8467a093984.tar.gz
gcc-ccbe00a43acc28143d9c37f45221d8467a093984.tar.bz2
re PR c++/26696 (ICE with statement forming unused static member function reference)
PR c++/26696 * cvt.c (convert_to_void): Replace a subexpression with no side effects with void_zero_node. * tree.c (is_overloaded_fn): Look through COMPONENT_REF. (get_first_fn): Ditto. * decl.c (grokdeclarator): No need to look through COMPONENT_REF. From-SVN: r116724
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r--gcc/cp/tree.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index db7e40a..89941cc 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -853,7 +853,8 @@ int
is_overloaded_fn (tree x)
{
/* A baselink is also considered an overloaded function. */
- if (TREE_CODE (x) == OFFSET_REF)
+ if (TREE_CODE (x) == OFFSET_REF
+ || TREE_CODE (x) == COMPONENT_REF)
x = TREE_OPERAND (x, 1);
if (BASELINK_P (x))
x = BASELINK_FUNCTIONS (x);
@@ -880,6 +881,8 @@ get_first_fn (tree from)
{
gcc_assert (is_overloaded_fn (from));
/* A baselink is also considered an overloaded function. */
+ if (TREE_CODE (from) == COMPONENT_REF)
+ from = TREE_OPERAND (from, 1);
if (BASELINK_P (from))
from = BASELINK_FUNCTIONS (from);
return OVL_CURRENT (from);