Skip to content

IntelliSense bug with preprocessor __COUNTER__  #9056

Closed as not planned
Closed as not planned

Description

@omegaelit

Bug type: Language Service

Describe the bug

  • OS and Version: Windows 10 Pro Build 19041.vb_release.191206-1406
  • VS Code Version: 1.65.2
  • C/C++ Extension Version: 1.9.5
  • Other extensions you installed (and if the issue persists after disabling them): None
  • If using SSH remote, specify OS of remote machine:
  • Single file example of the bug. When you hover enum, Intellisense works incorrectly with __COUNTER__, it shows different numbers every time, but with hovering testing::a it works correctly

Steps to reproduce

  1. Use code sample
  2. Hover enums and everytime it will show you different number
  3. Repeat second step
  4. See error

Expected behavior

I expect to see constant value

Code sample and logs

  • Code sample
    enum testing { a = __COUNTER__, b = __COUNTER__, c = __COUNTER__, d = __COUNTER__ };

  • Configurations in c_cpp_properties.json

  • Logs from running C/C++: Log Diagnostics from the VS Code command palette

  • Logs from the language server logging

Screenshots

Additional context

Activity

  1. sean-mcmanus commented on Mar 21, 2022

    @sean-mcmanus
    Contributor

    This is https://developercommunity2.visualstudio.com/t/Intellisense-__COUNTER__-macro/739122 -- it was closed as low priority. You could try re-filing it.

  2. bobbrow commented on Mar 19, 2026

    @bobbrow
    Contributor

    Thank you for the report. We’re closing this as not planned.
    The linked VS bug was closed as lower priority which means we will not be getting a fix in VS Code either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServiceVisual StudioInherited from Visual Studiobugmore votes neededIssues that have been postponed until more community members upvote it

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions