Re: Support for anonymous struct/union

Eric Ludlam <[email protected]> Wed, 22 Apr 2015 21:04:36 -0400
Newsgroups gmane.emacs.cedet
Message-ID <[email protected]>
On 04/19/2015 06:34 AM, Tu Do wrote:
> Also If I add a name to the anonymous struct/union, Semantic only gives
> that struct/union member as a single completion candidate.

Isn't that what it should do?

> On Sun, Apr 19, 2015 at 5:31 PM, Tu Do <[email protected]
> <mailto:[email protected]>> wrote:
>
>     Hi Eric,
>
>     Currently Semantic cannot return completion candidates for members
>     in anonymous struct/union like this:
>
>         struct s {
>            int a;
>            int b;
>            union {
>               char *str;
>               void *ptr;
>            };
>         };
>
>
>     even though Semantic parser returns the empty name anonymous union
>     with all of its members.

There is no special code to merge the anonymous union fields into the 
members of the hosting struct.

Is the issue here only that anonymous union members don't show up in the 
struct?

I committed a change that allows C to control what shows up when 
completion tries to dig into the members of a struct, along with a new 
test file (testunion.cpp) which you should check to make sure it does 
what you expect.


Eric

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF