sammccall added inline comments.
================ Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:91 + DeclRelation::Alias | DeclRelation::TemplatePattern)) { + // If the cursor is at the underlying CXXRecordDecl of the + // ClassTemplateDecl, ND will be the CXXRecordDecl. In this case, we need to ---------------- kbobyrev wrote: > sammccall wrote: > > why is this code being moved? > So, this code was previously only in the within-file rename path and hence > triggering rename from a constructor/destructor-s was only possible there. > Moving the code here improves overall "symbol selection" and fixes it for > global renames, too. Clangd as a whole actually canonicalizes in the other direction (templatedecl -> templated decl). So I think this change introduces a bug (the references you seek won't be in the index). Certainly up for discussion which is better (behavior is historical) but that's a larger change. ================ Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:96 + D = D->getDescribedTemplate() ? D->getDescribedTemplate() : D; + const auto *ND = llvm::dyn_cast<NamedDecl>(D); + // Get to CXXRecordDecl from constructor or destructor. ---------------- dyn_cast then unconditionally inserting seems dodgy - if it can be null, it must be checked, and if it can't, it should be plain `cast` CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71247/new/ https://reviews.llvm.org/D71247 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits