Re: [C++ Patch] Fix __is_base_of vs incomplete types

2014-01-06 Thread Jason Merrill
I think this is getting too tricky, so let's go back to your first patch (which is OK). Sorry about the runaround. Jason

Re: [C++ Patch] Fix __is_base_of vs incomplete types

2014-01-03 Thread Paolo Carlini
Hi, On 01/02/2014 10:46 PM, Jason Merrill wrote: On 12/27/2013 07:02 AM, Paolo Carlini wrote: the same arguments. Conservatively but still more neatly than my first try, we could maybe use same_type_ignoring_top_level_qualifiers_p in the definition of the DERIVED_FROM_P macro? Sure, let's do

Re: [C++ Patch] Fix __is_base_of vs incomplete types

2014-01-03 Thread Jason Merrill
On 01/03/2014 12:29 PM, Paolo Carlini wrote: - (lookup_base ((TYPE), (PARENT), ba_any, NULL, tf_none) != NULL_TREE) + (lookup_base ((TYPE), (PARENT), ba_any, NULL, tf_none) != NULL_TREE \ + || ((TYPE) NON_UNION_CLASS_TYPE_P (TYPE) \ +same_type_ignoring_top_level_qualifiers_p

Re: [C++ Patch] Fix __is_base_of vs incomplete types

2014-01-03 Thread Jason Merrill
On 01/03/2014 01:47 PM, Jason Merrill wrote: + issued. If the base in incomplete, then NULL_TREE is returned. */ If T is incomplete ...even if BASE is the same type. Jason

Re: [C++ Patch] Fix __is_base_of vs incomplete types

2014-01-03 Thread Paolo Carlini
Hi, On 01/03/2014 07:47 PM, Jason Merrill wrote: On 01/03/2014 12:29 PM, Paolo Carlini wrote: - (lookup_base ((TYPE), (PARENT), ba_any, NULL, tf_none) != NULL_TREE) + (lookup_base ((TYPE), (PARENT), ba_any, NULL, tf_none) != NULL_TREE \ + || ((TYPE) NON_UNION_CLASS_TYPE_P (TYPE) \ +

Re: [C++ Patch] Fix __is_base_of vs incomplete types

2014-01-03 Thread Paolo Carlini
... something like the attached appears to work. Not sure at the moment if it could be simplified. Thanks, Paolo. Index: cp/cp-tree.h === --- cp/cp-tree.h(revision 206318) +++ cp/cp-tree.h

Re: [C++ Patch] Fix __is_base_of vs incomplete types

2014-01-02 Thread Jason Merrill
On 12/27/2013 07:02 AM, Paolo Carlini wrote: the same arguments. Conservatively but still more neatly than my first try, we could maybe use same_type_ignoring_top_level_qualifiers_p in the definition of the DERIVED_FROM_P macro? Sure, let's do that. And add something about incomplete types to

Re: [C++ Patch] Fix __is_base_of vs incomplete types

2013-12-27 Thread Paolo Carlini
Hi, On 12/12/2013 03:19 PM, Jason Merrill wrote: I wouldn't expect it to cause problems. Ok. Then I looked a bit into this and something is making me nervous: lookup_base wants to return a binfo, not a type. Thus what do we do when the type is incomplete and there is no binfo? Something like

Re: [C++ Patch] Fix __is_base_of vs incomplete types

2013-12-12 Thread Jason Merrill
I wouldn't expect it to cause problems. Jason

Re: [C++ Patch] Fix __is_base_of vs incomplete types

2013-12-11 Thread Jason Merrill
Hmm, what if we make lookup_base handle incomplete types better? Jason

Re: [C++ Patch] Fix __is_base_of vs incomplete types

2013-12-11 Thread Paolo Carlini
Hi, On 12/12/2013 05:01 AM, Jason Merrill wrote: Hmm, what if we make lookup_base handle incomplete types better? I'm leaving for a few days of vacations, then I can certainly look into that, per se should be very doable. To be honest, I didn't consider that possibility because I feared it

[C++ Patch] Fix __is_base_of vs incomplete types

2013-12-07 Thread Paolo Carlini
Hi, noticed this while preparing some testcases for the library (but probably Daniel pointed it out together with related issues some time ago): if we don't handle separately identical types modulo cv-qualifiers, we incorrectly return false for incomplete types. Tested x86_64-linux.