[PATCH] D54395: [clang-tidy] implement utility-function to add 'const' to variables

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 20 13:18:31 PST 2018


JonasToth added inline comments.


================
Comment at: unittests/clang-tidy/AddConstTest.cpp:733
+  StringRef T = "template <typename T> void f(T v) \n";
+  StringRef S = "{ T target = v; }";
+  auto Cat = [&T](StringRef S) { return (T + S).str(); };
----------------
alexfh wrote:
> It would be interesting to see test cases with multiple instantiations of the template the fix applies to.
I added test for a template function with many instantiations, but there should not be a difference between the instantiations, because only the original code would be transformed, and there the 'how it looks' counts, so in this case it will be treated as a value.
Did I misinterpret your question?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54395





More information about the cfe-commits mailing list