Skip to content

New IS engine is unable to recognize C99 for loop initial declaration #685

@mikedld

Description

@mikedld

I'm using v0.11.0 with Default IS mode and Enabled error squiggles, and editing C file (with .c extension). This seems to work fine (pre-C99):

int i;
for (i = 0; i < 10; ++i) ...

Moving variable declaration into the for construct like this (C99):

for (int i = 0; i < 10; ++i) ...

leads to error squiggles saying "expected an expression" and "identifier "i" is undefined". Changing "int" in the above example to a typedef-ed type leads to a bit different set of errors: "type name is not allowed", "expected a ';'", and "identifier "i" is undefined".

This is confusing as some other C99 features like intermixing code and variable declarations are being processed just fine. And even more confusing as you advertise this new IS engine as being based on MSVC IS engine and VS 2015 has no trouble recognizing the above construct as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions