This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Using declarations should not conflict (PR/2294) - TAKE 2
- From: "Giovanni Bajo" <giovannibajo at libero dot it>
- To: "Jason Merrill" <jason at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 5 Dec 2003 19:41:04 +0100
- Subject: Re: [C++ PATCH] Using declarations should not conflict (PR/2294) - TAKE 2
- References: <008101c3b065$89d37cf0$1e01a8c0@prograph.it> <xypznebokn9.fsf@miranda.boston.redhat.com>
Jason Merrill <jason@redhat.com> wrote:
>> tree class_size = size_in_bytes (true_type);
>> static const char alloc_name[] = "_Jv_AllocObject";
>> use_java_new = 1;
>> ! if (!get_global_value_if_present (get_identifier (alloc_name),
>> ! &alloc_decl))
>> fatal_error ("call to Java constructor with `%s' undefined",
>> alloc_name);
>> ! if (is_overloaded_fn (alloc_decl))
>> ! {
>> ! if (really_overloaded_fn (alloc_decl))
>> ! fatal_error ("`%s' should never be overloaded", alloc_name);
>> ! alloc_decl = OVL_FUNCTION (alloc_decl);
>> ! }
>
> You can use OVL_CURRENT rather than check is_overloaded_fn. Also, that
> should be
>
> internal_error ("`%D' should never be overloaded", alloc_decl);
On second thought, even if the code is usually within libjava, an user could
manually declare an overload to _Jv_AllocObject. Do we really want to emit an
internal error even in this situation? I thought we shouldn't emit an internal
error for any user input, but I don't know if there are different rules for
this semi-builtins.
Giovanni Bajo