News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Code complete for unnamed struct/union fields

Started by plainzw, August 02, 2013, 05:12:42 PM

Previous topic - Next topic

plainzw

when a struct contains a unnamed union(struct) which contains another struct, code complete can't display the fields of struct inside the unnamed union.

struct TestB
{
    int a;
    int b;
};

struct TestA
{
    union
    {
        TestB c;
        int d;
    };
};

int main()
{
    struct TestA t;
    t.c.a = 5;
    return 0;
}

when typing "t.c." ,code complete doesn't show the fields "a" and "b" of struct TestB. However,it works fine when defining a unnamed union variable like this:
union
{
     TestB c;
     int d;
}u;