This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] types_compatible_p mess 2/3 (C++)


Richard Guenther wrote:
On Thu, Mar 6, 2008 at 2:36 PM, Paolo Bonzini <bonzini@gnu.org> wrote:
It seems to me that lang_hooks.types_compatible_p should never be called
 with reference types.  I tested this with the testcase

 extern int printf (const char *, ...);
 int f(int &x)
 {
   printf ("%p", &x);
 }

Ok?

If this part is only for calls from the middle-end then the patch makes sense. Otherwise I have no opinion on it, but maybe you can add an assert and a comment?

The middle-end never calls it with anything but aggregates (see useless_type_conversion_p_1). I think the front-end and in particular c-format.c shouldn't call it with references (hence the above testcase) but if it did, you probably don't want anyway the code that my patch removes.


Paolo


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]