diff options
author | Mark Mitchell <mark@markmitchell.com> | 1998-07-16 11:46:44 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-07-16 11:46:44 +0000 |
commit | 52889bc8181bed43cc0dff3e285f57cff9b9d2ab (patch) | |
tree | a6e848c78d9073f720fbddc475ad6ab9b8ba81be /gcc/cp | |
parent | 439041b9178b4e49c55eecc0a79d332b18a91e3d (diff) | |
download | gcc-52889bc8181bed43cc0dff3e285f57cff9b9d2ab.zip gcc-52889bc8181bed43cc0dff3e285f57cff9b9d2ab.tar.gz gcc-52889bc8181bed43cc0dff3e285f57cff9b9d2ab.tar.bz2 |
semantics.c (finish_object_call_expr): Move test for the function called being a TYPE_DECL to ...
1998-07-16 Mark Mitchell <mark@markmitchell.com>
* semantics.c (finish_object_call_expr): Move test for the
function called being a TYPE_DECL to ...
* call.c (build_new_method_call): Here.
From-SVN: r21213
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/call.c | 6 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 6 |
3 files changed, 12 insertions, 6 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 37a85a7..08b57eb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +1998-07-16 Mark Mitchell <mark@markmitchell.com> + + * semantics.c (finish_object_call_expr): Move test for the + function called being a TYPE_DECL to ... + * call.c (build_new_method_call): Here. + 1998-07-15 Jason Merrill <jason@yorick.cygnus.com> * decl2.c (arg_assoc_class): Also look at template arguments, if any. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 3e11a74..7a87191 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -3552,6 +3552,12 @@ build_new_method_call (instance, name, args, basetype_path, flags) template_only = 1; } + if (TREE_CODE (name) == TYPE_DECL) + { + cp_error ("calling type `%T' like a method", name); + return error_mark_node; + } + /* If there is an extra argument for controlling virtual bases, remove it for error reporting. */ if (flags & LOOKUP_HAS_IN_CHARGE) diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index fe4709a..cae0b67 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -922,12 +922,6 @@ finish_object_call_expr (fn, object, args) tree real_fn = build_component_ref (object, fn, NULL_TREE, 1); return finish_call_expr (real_fn, args); #else - if (TREE_CODE (fn) == TYPE_DECL) - { - cp_error ("calling type `%T' like a method", fn); - return error_mark_node; - } - return build_method_call (object, fn, args, NULL_TREE, LOOKUP_NORMAL); #endif } |