diff options
author | Mark Mitchell <mark@codesourcery.com> | 2002-08-02 18:53:40 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2002-08-02 18:53:40 +0000 |
commit | 4a34e0e8cf793442874c3fa4d7edafa96b9da5ba (patch) | |
tree | 4627ad44b96fe6c49914f19dc96eff07790cb71a /gcc | |
parent | 74d6b8ca6307ef057ba438f785f46eb9c911b184 (diff) | |
download | gcc-4a34e0e8cf793442874c3fa4d7edafa96b9da5ba.zip gcc-4a34e0e8cf793442874c3fa4d7edafa96b9da5ba.tar.gz gcc-4a34e0e8cf793442874c3fa4d7edafa96b9da5ba.tar.bz2 |
call.c (build_method_call): Issue a more helpful error message about ambiguous method names.
* call.c (build_method_call): Issue a more helpful error message
about ambiguous method names.
From-SVN: r55994
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/call.c | 12 |
2 files changed, 14 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 24bec89..b6db3f6 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2002-08-02 Mark Mitchell <mark@codesourcery.com> + + * call.c (build_method_call): Issue a more helpful error message + about ambiguous method names. + 2002-08-02 Nathan Sidwell <nathan@codesourcery.com> * tree.c (build_shared_int_cst): Make cache file scope, and diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 9029a70..7b938b9 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -545,11 +545,17 @@ build_method_call (instance, name, parms, basetype_path, flags) else if (DECL_P (name)) name = DECL_NAME (name); if (has_template_args) - fn = lookup_fnfields (object_type, name, /*protect=*/0); + fn = lookup_fnfields (object_type, name, /*protect=*/2); else - fn = lookup_member (object_type, name, /*protect=*/0, - /*want_type=*/0); + fn = lookup_member (object_type, name, /*protect=*/2, /*want_type=*/0); + if (fn && TREE_CODE (fn) == TREE_LIST && !BASELINK_P (fn)) + { + error ("request for member `%D' is ambiguos", name); + print_candidates (fn); + return error_mark_node; + } + /* If the name could not be found, issue an error. */ if (!fn) { |