Re: [C++ Patch] PR 50732

2011-10-15 Thread Jason Merrill
OK. Jason

Re: [C++ Patch] PR 50732

2011-10-15 Thread Paolo Carlini
On 10/15/2011 08:33 PM, Jason Merrill wrote: On 10/14/2011 06:57 PM, Paolo Carlini wrote: - return false; + return complete_type_or_else (type, NULL_TREE); I think I'd do complete_type_or_else (strip_array_types (type), NULL_TREE) so that the error doesn't complain about unspecified boun

Re: [C++ Patch] PR 50732

2011-10-15 Thread Jason Merrill
On 10/14/2011 06:57 PM, Paolo Carlini wrote: - return false; + return complete_type_or_else (type, NULL_TREE); I think I'd do complete_type_or_else (strip_array_types (type), NULL_TREE) so that the error doesn't complain about unspecified bounds, which would be misleading. Jason

Re: [C++ Patch] PR 50732

2011-10-14 Thread Paolo Carlini
On 10/15/2011 12:20 AM, Jason Merrill wrote: That should work. Excellent. Then we can do something like the below, a great improvement. I'm finishing testing it (already past g++.dg), Ok if it passes? Thanks, Paolo. /// /cp 2011-10-14 Paolo Carlini PR c++/50732

Re: [C++ Patch] PR 50732

2011-10-14 Thread Jason Merrill
On 10/14/2011 05:58 PM, Paolo Carlini wrote: On 10/14/2011 09:08 PM, Jason Merrill wrote: How about using complete_type_or_else? The CPTK_IS_BASE_OF case becomes much simpler indeed, thanks. For the unary traits, though, I don't see an advantage in using it, because in some cases in check_trait

Re: [C++ Patch] PR 50732

2011-10-14 Thread Paolo Carlini
On 10/14/2011 09:08 PM, Jason Merrill wrote: How about using complete_type_or_else? The CPTK_IS_BASE_OF case becomes much simpler indeed, thanks. For the unary traits, though, I don't see an advantage in using it, because in some cases in check_trait_type we don't want to error out even when c

Re: [C++ Patch] PR 50732

2011-10-14 Thread Jason Merrill
How about using complete_type_or_else? Jason

Re: [C++ Patch] PR 50732

2011-10-14 Thread Paolo Carlini
On 10/14/2011 08:30 PM, Paolo Carlini wrote: On 10/14/2011 08:23 PM, Paolo Carlini wrote: Hi, submitter complains that, at variance with C++11, __is_base_of doesn't handle an incomplete base type (the first parameter). The reason seems simple: in finish_trait_expr we try to complete *both* t

Re: [C++ Patch] PR 50732

2011-10-14 Thread Paolo Carlini
On 10/14/2011 08:23 PM, Paolo Carlini wrote: Hi, submitter complains that, at variance with C++11, __is_base_of doesn't handle an incomplete base type (the first parameter). The reason seems simple: in finish_trait_expr we try to complete *both* types instead of doing it where/when necessary.