[PATCH] D39120: [rename] Don't overwrite the template argument when renaming a template function.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 20 06:44:00 PDT 2017


hokein added inline comments.


================
Comment at: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp:227
+    SourceLocation EndLoc = Expr->hasExplicitTemplateArgs()
+                                ? Expr->getLAngleLoc().getLocWithOffset(-1)
+                                : Expr->getLocEnd();
----------------
ioeric wrote:
> hokein wrote:
> > ioeric wrote:
> > > I wonder what would happen if we have `foo       <int>()`?
> > There will be a blank left like `bar <int>();` if we don't format the apply replacement, but I don't think this case really matters because we often format the placements before applying them.
> Could you add a test for this? Thanks!
Done, but note that our unittest will format the expected/actual code before doing verification.


https://reviews.llvm.org/D39120





More information about the cfe-commits mailing list