Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 252 forks source link

failure to find reference to child virtual override in template class #1397

Open Jacob-Burckhardt opened 4 years ago

Jacob-Burckhardt commented 4 years ago

When the cursor is on Child::joe definition, rtags-find-references-at-point finds nothing. It should have found the call to joe in main().

template<typename T>
struct Parent {
   virtual void joe()=0;
};

template<typename T>
struct Child : public Parent<T> {
   virtual void joe() {};
};

int main() {
   Child<int> c;
   Parent<int> &p = c;
   p.joe();
}

If modified to remove templates, then it does find the call in main():

struct Parent {
   virtual void joe()=0;
};

struct Child : public Parent {
   virtual void joe() {};
};

int main() {
   Child c;
   Parent &p = c;
   p.joe();
}

813 might be a related bug.

Environment (please complete the following information):