This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] accept flexible arrays in struct in unions (c++/71912 - [6/7 regression])
On Tue, Aug 2, 2016 at 10:13 PM, Martin Sebor <msebor@gmail.com> wrote:
> The change let me replace an if statement and the ANONCTX data
> member with a new function plus a conditional. I'll let you be
> the judge but to me it doesn't seem like an improvement.
You can use the existing context_for_name_lookup instead of a new function.
>> Hmm, doesn't that mean that
>>
>> typedef struct { int a[]; } B;
>>
>> is never handled? Perhaps you want to do this check from
>> cp_parser_simple_declaration, when we know whether or not there's a
>> declarator?
>
> Yes, it does mean that and it's one of the outstanding bugs that
> still need fixing (in 7.0). Same way top-level arrays aren't
> handled.
If you're going to temporarily handle member typedefs here, please add
a prominent FIXME about removing that handling when typedefs get fixed
properly.
Jason