Skip to content

local variable between #ifdef and #endif can't go to definition if macro isn't defined. #3108

@Lennon925

Description

@Lennon925

Type: LanguageService

Describe the bug

  • OS and Version:
  • VS Code Version: 1.30.2
  • C/C++ Extension Version: 0.21.0
  • Other extensions you installed (and if the issue persists after disabling them):
  • A clear and concise description of what the bug is.

codes as blow:

#define DEBUG_CHECK_RANGE 1;

void test()
{
int count = 0;
#ifdef DEBUG_CHECK_RANGE0 // it's not defined
int local = 0;
local++; // can't go to definition
count++; // can't go to definition
#endif
count++; //it's ok
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions