Skip to content

Anonymous enums are not recognized #10436

@James-Dengel

Description

@James-Dengel

Environment

  • OS and Version: MacOS Catalina

  • VS Code Version:
    Version: 1.72.0 (Universal)
    Commit: 64bbfbf67ada9953918d72e1df2f4d8e537d340e
    Date: 2022-10-04T23:21:58.256Z
    Electron: 19.0.17
    Chromium: 102.0.5005.167
    Node.js: 16.14.2
    V8: 10.2.154.15-electron.0
    OS: Darwin x64 19.6.0
    Sandboxed: No

  • C/C++ Extension Version: v1.12.4

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServiceVisual StudioInherited from Visual StudiobugfixedCheck the Milestone for the release in which the fix is or will be available.

    Type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions