diff options
author | Mark Mitchell <mark@codesourcery.com> | 2002-08-02 22:42:03 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2002-08-02 22:42:03 +0000 |
commit | 55765de4413d1aea5bc847924b5cd2430f4974cb (patch) | |
tree | 168eb96b45996d9782b715eabfdb7fbe787d12b8 /gcc/cp | |
parent | ba462c8e9d2fbe607e1b9c3f9bf05dee1148fe37 (diff) | |
download | gcc-55765de4413d1aea5bc847924b5cd2430f4974cb.zip gcc-55765de4413d1aea5bc847924b5cd2430f4974cb.tar.gz gcc-55765de4413d1aea5bc847924b5cd2430f4974cb.tar.bz2 |
init.c (build_member_call): Use build_new_method_call, not build_method_call.
* init.c (build_member_call): Use build_new_method_call, not
build_method_call.
* g++.dg/inherit/access3.C: New test.
From-SVN: r56000
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/init.c | 19 |
2 files changed, 18 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c39ea5a..34315e4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2002-08-02 Mark Mitchell <mark@codesourcery.com> + + * init.c (build_member_call): Use build_new_method_call, not + build_method_call. + 2002-08-02 Krister Walfridsson <cato@df.lth.se> * Make-lang.in (spew.o, lex.o, pt.o): Add path to parse.h dependencies. diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 421a00a..6286a22 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -1434,6 +1434,7 @@ build_member_call (type, name, parmlist) { tree t; tree method_name; + tree fns; int dtor = 0; tree basetype_path, decl; @@ -1511,6 +1512,18 @@ build_member_call (type, name, parmlist) decl = maybe_dummy_object (type, &basetype_path); + fns = lookup_fnfields (basetype_path, method_name, 0); + if (fns) + { + if (TREE_CODE (name) == TEMPLATE_ID_EXPR) + BASELINK_FUNCTIONS (fns) = build_nt (TEMPLATE_ID_EXPR, + BASELINK_FUNCTIONS (fns), + TREE_OPERAND (name, 1)); + return build_new_method_call (decl, fns, parmlist, + /*conversion_path=*/NULL_TREE, + LOOKUP_NORMAL|LOOKUP_NONVIRTUAL); + } + /* Convert 'this' to the specified type to disambiguate conversion to the function's context. */ if (decl == current_class_ref @@ -1527,12 +1540,6 @@ build_member_call (type, name, parmlist) if (constructor_name_p (method_name, type)) return build_functional_cast (type, parmlist); - if (lookup_fnfields (basetype_path, method_name, 0)) - return build_method_call (decl, - TREE_CODE (name) == TEMPLATE_ID_EXPR - ? name : method_name, - parmlist, basetype_path, - LOOKUP_NORMAL|LOOKUP_NONVIRTUAL); if (TREE_CODE (name) == IDENTIFIER_NODE && ((t = lookup_field (TYPE_BINFO (type), name, 1, 0)))) { |