Re: [C++ Patch] PR 24926

2013-09-04 Thread Paolo Carlini
Hi, >> Or you mean something else? > >I was thinking that the recursive part could be a simple loop to set >access, but your way is fine too. Ok, great. Note, before committing I mean to also simplify it a bit, the TREE_STATIC check of the recursive part has no reason to exist, doesn't exist

Re: [C++ Patch] PR 24926

2013-09-04 Thread Jason Merrill
On 09/04/2013 10:42 AM, Paolo Carlini wrote: Indeed. I think the recursive part already does that, because only the first time is called complain == true (thus does exactly what the current code does), then when the recursion proper starts, complain == false. Ah yes, I see. Or you mean someth

Re: [C++ Patch] PR 24926

2013-09-04 Thread Paolo Carlini
Hi, On 09/04/2013 03:11 PM, Jason Merrill wrote: It looks to me like this will result in duplicate diagnostics for invalid members in a nested anonymous union. Maybe make the recursive part only handle access setting? Indeed. I think the recursive part already does that, because only the firs

Re: [C++ Patch] PR 24926

2013-09-04 Thread Jason Merrill
It looks to me like this will result in duplicate diagnostics for invalid members in a nested anonymous union. Maybe make the recursive part only handle access setting? Jason

Re: [C++ Patch] PR 24926

2013-09-04 Thread Paolo Carlini
... assuming the general idea makes sense, this version may be better because, at the cost of 3 lines of code duplication, it cuts the unnecessary function calls, eg exactly zero if the struct doesn't have anonymous aggregates at all. The patch is also easier to read ;) Booted and tested x86_6

[C++ Patch] PR 24926

2013-09-03 Thread Paolo Carlini
Hi, of the various access control issues we have got, this one seems rather manageable. It seems to me that in case of nested anonymous aggregates what is needed to get the access control right is just a bit of recursion, to completely propagate the access from the outer to the inner aggrega