Closed Bug 1833272 Opened 2 years ago Closed 2 years ago

Navigation to templated method is still tripped up by use of this->

Categories

(Webtools :: Searchfox, defect)

defect

Tracking

(firefox115 fixed)

RESOLVED FIXED
Tracking Status
firefox115 --- fixed

People

(Reporter: botond, Assigned: botond)

References

Details

Attachments

(1 file)

Steps to reproduce

Have Searchfox index the following code:

template <typename> struct Point {};

template <typename T>
struct Foo {
  template <typename F>
  void Project(Point<F>) {}

  void Bar() {
    Point<T> tp;
    this->Project(tp);
  }
};

Expected results

Navigation from the call to Project() goes to the definition.

Actual results

No navigation is offered at the call.

The this-> changes the expression type from UnresolvedMemberExpr (which is a subclass of OverloadExpr) to CXXDependentScopeMemberExpr, and since the target is a function template, HeuristicResolver::resolveMemberExpr() gives us a FunctionTemplateDecl, which is not a FunctionDecl. We need to unwrap the TemplateDecl the way we do in VisitOverloadExpr().

Depends on: 1833072
Pushed by bballo@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/da27ccc7c99a Handle templated heuristic results in VisitCXXDependentScopeMemberExpr. r=asuth DONTBUILD
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: