Skip to content

HeuristicResolver cannot resolve chained dependent field access #124450

@HighCommander4

Description

@HighCommander4

In the following code:

int next;

template <typename T>
struct Link {
  Link<T> *next;
};

template <typename T>
void foo(Link<T> *link) {
  link->next->next;
}

HeuristicResolver is able to resolve the first next in link->next->next, but not the second.

This can be seen in clangd: go-to-definition on the second next will also offer the unrelated global variable as a result, indicating that it's falling back to the textual heuristic because semantic resolution failed.

Metadata

Metadata

Labels

clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions