[PATCH] D62579: [Index] Compute correct symbol kind for variable templates

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 29 08:06:19 PDT 2019

ilya-biryukov added inline comments.

Comment at: clang/lib/Index/IndexSymbol.cpp:99
+  if (auto *VT = dyn_cast<VarTemplateDecl>(D)) {
+    Info.Properties |= (SymbolPropertySet)SymbolProperty::Generic;
kadircet wrote:
> what about function and class templates? Are they handled in somewhere else?
Yeah, they're handled in ifs and a large switch below. I tried unifying those cases (matching a `TemplateDecl` here instead of `VarTemplateDecl`), but they start producing different results for template classes and this function is **mostly** not called for templates from withing the index library (only for the underlying declarations) and it's only clangd that cares about the returned value in that case.

So I decided to make a minimal change that fixes clangd, but does not change behavior of the index library to avoid potential fallout of a more general fix.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list