Skip to content

Designated initializer for struct with embedded struct shows missing field #2363

@ghost

Description

Type: LanguageService
Designated initializer for struct with embedded struct shows missing field but shouldn't.

  • OS and Version: Windows 7
  • VS Code Version: 1.25.1
  • C/C++ Extension Version: 0.17.7
  • gcc (i686-posix-dwarf, Built by MinGW-W64 project) 6.1.0

To Reproduce
Save following code as c file:

struct foo {
    int x;
};

struct bar {
    struct foo;
    int y;
};

int main() {
    struct bar bar = {.x=12, .y=13};
}

Shown message:
struct_embedding

The code compiles and runs though.

Expected behavior
No missing field message shown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.parser

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions