Skip to content

symbol behind “goto“ can't go to definition correctly. #3111

@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:

void strtoull(bool isTure, int x)
{
if (x > 36)
goto destination; //location1, "go to definition" for destination will go to location1.
if (isTure)
{
x++;
goto destination; //location2, "go to definition" for destination will go to location1.
}
destination:
x--;
}

but it's right if you place destination region to some place before "goto" like this:

void strtoull(bool isTure, int x)
{
unsigned long long ret = 0;
destination:
x--;
if (x > 36)
goto destination;
if (isTure)
{
x++;
goto destination;
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: Go to DefinitionAn issue related to Go to Definition/Declaration.Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.quick fix

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions