nridge marked an inline comment as done.
nridge added inline comments.
================
Comment at: clang-tools-extra/clangd/XRefs.cpp:240
+ // it's more useful to navigate to the template declaration.
+ if (Preferred->getLocation() == IdentStartLoc) {
+ if (auto *CTSD = dyn_cast<ClassTemplateSpecializationDecl>(Preferred)) {
----------------
nridge wrote:
> sammccall wrote:
> > sammccall wrote:
> > > Be aware that this is going to break "go to definition" toggling between
> > > def and decl. I think that's fine.
> > (I think you probably want the macro-arg-expanded location here)
> For what will this break toggling? Aas far as I'm aware, partial and explicit
> specializations of templates do not have separate declarations.
I stand corrected: I checked, and it seems like specializations can indeed have
forward declarations.
I expect they are relatively rare, though, and it's probably fine to break
toggling for them, like you said.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71090/new/
https://reviews.llvm.org/D71090
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits