init.c (build_offset_ref): Handle the case of a templated member function.

* init.c (build_offset_ref): Handle the case of a templated member
        function.

From-SVN: r32649
This commit is contained in:
Theodore Papadopoulo 2000-03-20 18:44:24 +01:00 committed by Jason Merrill
parent 949d707dcf
commit c65a922c68
2 changed files with 20 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2000-03-20 Theodore Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>
* init.c (build_offset_ref): Handle the case of a templated member
function.
2000-03-19 Martin v. Löwis <loewis@informatik.hu-berlin.de>
* except.c (expand_exception_blocks): Clear catch_clauses_last.

View File

@ -1577,9 +1577,21 @@ build_offset_ref (type, name)
the template-id that was used. */
name = TREE_OPERAND (orig_name, 0);
if (TREE_CODE (name) == LOOKUP_EXPR)
/* This can happen during tsubst'ing. */
name = TREE_OPERAND (name, 0);
if (DECL_P (name))
name = DECL_NAME (name);
else
{
if (TREE_CODE (name) == LOOKUP_EXPR)
/* This can happen during tsubst'ing. */
name = TREE_OPERAND (name, 0);
else
{
if (TREE_CODE (name) == COMPONENT_REF)
name = TREE_OPERAND (name, 1);
if (TREE_CODE (name) == OVERLOAD)
name = DECL_NAME (OVL_CURRENT (name));
}
}
my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 0);
}