From: Theodore Papadopoulo Date: Mon, 20 Mar 2000 17:44:24 +0000 (+0100) Subject: init.c (build_offset_ref): Handle the case of a templated member function. X-Git-Tag: prereleases/libstdc++-2.92~7582 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c65a922c68fcaafce36473e2e940cd5c9d12d7fe;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 83cec30b863b..f1a2f8adcbe4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-03-20 Theodore Papadopoulo + + * init.c (build_offset_ref): Handle the case of a templated member + function. + 2000-03-19 Martin v. Löwis * except.c (expand_exception_blocks): Clear catch_clauses_last. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 8994f6042392..f2aba2ced827 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -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); }