microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.45k stars 1.53k forks source link

Anonymous enums are not recognized #10436

Open James-Dengel opened 1 year ago

James-Dengel commented 1 year ago

Environment

Bug Summary and Steps to Reproduce

Using anonymous enums with a size produces a swiggle under the colon for the error: expected either a definition or a tag name (C/C++ 110)

then a swiggle under the open curly bracket: expected an identifier (C/C++ 40)

The values of the enum are then unrecognised: identifier "ZERO" is undefined

typedef enum : uint8_t { ZERO = 0x00, // zero ONE = 0x01, // one TWO = 0x02, // two FOUR = 0x04, // Four } NUMBERS;

typedef enum  uint8_t

Configuration and Logs

c_cpp_properties.json;
{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**",
                "${workspaceFolder}/src/**"
            ],
            "defines": [],
            "macFrameworkPath": [
                "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/System/Library/Frameworks"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c17",
            "cppStandard": "c++11",
            "intelliSenseMode": "macos-clang-x64",
            "compileCommands": "compile_command.json"
        }
    ],
    "version": 4
}

Other Extensions

No response

Additional context

No response

browntarik commented 1 year ago

Thank you for submitting this issue! We are currently looking into this and will get back to you soon.

browntarik commented 1 year ago

We have filed a bug with the Visual Studio team (1741473) and a fix should be made soon. This GitHub issue will track the progress of the fix.