Re: [C++ Patch] PR 66644

2016-04-29 Thread Jason Merrill
OK, thanks. Jason

Re: [C++ Patch] PR 66644

2016-04-29 Thread Paolo Carlini
Hi, On 29/04/2016 15:58, Jason Merrill wrote: On 04/28/2016 08:18 PM, Paolo Carlini wrote: else if (ANON_AGGR_TYPE_P (type)) { - tree fields; - - for (fields = TYPE_FIELDS (type); fields; fields = DECL_CHAIN (fields)) + for (tree fields = TYPE_FIELDS (type); fields; +

Re: [C++ Patch] PR 66644

2016-04-29 Thread Jason Merrill
On 04/28/2016 08:18 PM, Paolo Carlini wrote: else if (ANON_AGGR_TYPE_P (type)) { - tree fields; - - for (fields = TYPE_FIELDS (type); fields; fields = DECL_CHAIN (fields)) + for (tree fields = TYPE_FIELDS (type); fields; + fields = DECL_CHAIN (fields)) if

Re: [C++ Patch] PR 66644

2016-04-28 Thread Paolo Carlini
Hi Jason, On 28/04/2016 23:45, Jason Merrill wrote: I would expect this to cause a false negative on a union of two anonymous structs, both of which have initialized members. I think better would be to have a local any_default_members rather than passing the same pointer through all levels.

Re: [C++ Patch] PR 66644

2016-04-28 Thread Jason Merrill
I would expect this to cause a false negative on a union of two anonymous structs, both of which have initialized members. I think better would be to have a local any_default_members rather than passing the same pointer through all levels. Also, you can look at 'type' rather than DECL_CONTEXT

[C++ Patch] PR 66644

2016-04-28 Thread Paolo Carlini
Hi, only when Jakub bumped some bugs in preparation for the release I noted that this one remained assigned to me for way too much time... Roughly speaking, the problem is caused by the fact that when we have a GNU anonymous struct inside a union the fields are flattened out and appear to be

[C++ Patch] PR 66644

2015-07-08 Thread Paolo Carlini
Hi, this is about the anonymous struct extension, but I think submitter is right that we should accept the testcase (indeed both clang and edg already do): in the below I propose to simply add a test of ANON_AGGR_TYPE_P (DECL_CONTEXT (field)). Note that, given the definition of ANON_AGGR_TYPE