alexfh requested changes to this revision. This revision now requires changes to proceed.
================ Comment at: clang-rename/USRFinder.cpp:80 @@ -79,1 +79,3 @@ TypeBeginLoc, 0, Context.getSourceManager(), Context.getLangOpts()); + if (const auto *TemplateTypeParm = dyn_cast<TemplateTypeParmType>(Loc.getType())) { + return setResult(TemplateTypeParm->getDecl(), TypeBeginLoc, TypeEndLoc); ---------------- It's not common to use braces around single-line `if` bodies in LLVM/Clang code. ================ Comment at: clang-rename/USRLocFinder.cpp:104 @@ -103,1 +103,3 @@ } + if (const auto TemplateTypeParm = dyn_cast<TemplateTypeParmType>(Loc.getType())) { + if (getUSRForDecl(TemplateTypeParm->getDecl()) == USR) { ---------------- nit: `const auto *` ================ Comment at: test/clang-rename/TemplateTypenameFindByTemplateParam.cpp:1 @@ -1,8 +1,2 @@ -// RUN: cat %s > %t.cpp -// RUN: clang-rename -offset=270 -new-name=U %t.cpp -i -- -// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s - -// Currently unsupported test. -// FIXME: clang-rename should be able to rename template parameters correctly. -// XFAIL: * +// RUN: clang-rename -offset=87 -new-name=Bar %s -- | FileCheck %s ---------------- As noted elsewhere, this way of testing is wrong. ================ Comment at: test/clang-rename/TemplateTypenameFindByTypeInside.cpp:1 @@ -1,6 +1,2 @@ -// RUN: clang-rename -offset=289 -new-name=U %s -- | FileCheck %s - -// Currently unsupported test. -// FIXME: clang-rename should be able to rename template parameters correctly. -// XFAIL: * +// RUN: clang-rename -offset=153 -new-name=Bar %s -- | FileCheck %s ---------------- ditto https://reviews.llvm.org/D22853 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits