Re: [C++ Patch] PR 52487

2012-03-22 Thread Paolo Carlini
On 03/22/2012 07:28 PM, Jason Merrill wrote: On 03/22/2012 12:58 PM, Paolo Carlini wrote: Anyway, I also think not calling literal_type_p from check_field_decls if the type is incomplete is pretty ugly, but I'm not sure which is the best way to make progress I guess that's OK. Just add a commen

Re: [C++ Patch] PR 52487

2012-03-22 Thread Jason Merrill
On 03/22/2012 12:58 PM, Paolo Carlini wrote: Anyway, I also think not calling literal_type_p from check_field_decls if the type is incomplete is pretty ugly, but I'm not sure which is the best way to make progress I guess that's OK. Just add a comment explaining that we'll get an error later.

Re: [C++ Patch] PR 52487

2012-03-22 Thread Gabriel Dos Reis
On Thu, Mar 22, 2012 at 11:58 AM, Paolo Carlini wrote: > On 03/22/2012 03:49 PM, Jason Merrill wrote: >> >> It's ill-formed to have a field with incomplete type.  The best thing >> would be to complain about that before we get to literal_type_p so that >> errorcount is set, if that's not too compl

Re: [C++ Patch] PR 52487

2012-03-22 Thread Paolo Carlini
On 03/22/2012 03:49 PM, Jason Merrill wrote: It's ill-formed to have a field with incomplete type. The best thing would be to complain about that before we get to literal_type_p so that errorcount is set, if that's not too complicated. Agreed. The problem is that if we just change check_field_d

Re: [C++ Patch] PR 52487

2012-03-22 Thread Jason Merrill
It's ill-formed to have a field with incomplete type. The best thing would be to complain about that before we get to literal_type_p so that errorcount is set, if that's not too complicated. Jason

Re: [C++ Patch] PR 52487

2012-03-20 Thread Paolo Carlini
... this simple also passes testing. Paolo. /cp 2012-03-20 Paolo Carlini PR c++/52487 * class.c (check_field_decls): Call literal_type_p only on complete types. /testsuite 2012-03-20 Paolo Carlini PR c++/52487 * g++.dg/cpp0x/l

Re: [C++ Patch] PR 52487

2012-03-20 Thread Paolo Carlini
On 03/20/2012 08:22 PM, Jason Merrill wrote: That assert is there to make sure that we don't try to test for literality of an incomplete type. We should check for completeness before trying to check for literality. You mean, in the relevant caller, here in check_field_decls: /* If at le

Re: [C++ Patch] PR 52487

2012-03-20 Thread Jason Merrill
That assert is there to make sure that we don't try to test for literality of an incomplete type. We should check for completeness before trying to check for literality. Jason

[C++ Patch] PR 52487

2012-03-20 Thread Paolo Carlini
Hi, this regression is about literal_type_p ICEing for types which cannot be completed. Indeed, for the testcase, complete_type cannot complete the type but doesn't error out either, just returns the type as-is, and the gcc_assert triggers. We could imagine handling such types in the caller -