[C++ PATCH] Using declarations should not conflict (PR/2294) - TAKE 2

Giovanni Bajo giovannibajo@libero.it
Fri Dec 5 18:41:00 GMT 2003


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



More information about the Gcc-patches mailing list