diff --git a/clang-tools-extra/clangd/refactor/Rename.cpp b/clang-tools-extra/clangd/refactor/Rename.cpp --- a/clang-tools-extra/clangd/refactor/Rename.cpp +++ b/clang-tools-extra/clangd/refactor/Rename.cpp @@ -184,13 +184,6 @@ if (!Index) return ReasonToReject::NoIndexProvided; - // Blacklist symbols that are not supported yet in cross-file mode due to the - // limitations of our index. - // FIXME: Renaming templates requires to rename all related specializations, - // our index doesn't have this information. - if (RenameDecl.getDescribedTemplate()) - return ReasonToReject::UnsupportedSymbol; - // FIXME: Renaming virtual methods requires to rename all overridens in // subclasses, our index doesn't have this information. // Note: Within-file rename does support this through the AST. diff --git a/clang-tools-extra/clangd/unittests/RenameTests.cpp b/clang-tools-extra/clangd/unittests/RenameTests.cpp --- a/clang-tools-extra/clangd/unittests/RenameTests.cpp +++ b/clang-tools-extra/clangd/unittests/RenameTests.cpp @@ -888,6 +888,23 @@ )cpp", }, { + // class templates. + R"cpp( + template + class [[Foo]] {}; + // FIXME: explicit template specilizations are not supported due the + // clangd index limitations. + template <> + class Foo {}; + )cpp", + R"cpp( + #include "foo.h" + void func() { + [[F^oo]] foo; + } + )cpp", + }, + { // class methods. R"cpp( class Foo {