[PATCH] D63482: [clang-tidy] Fix the YAML created for checks like modernize-pass-by-value

Ivan Donchevskii via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 2 00:33:25 PDT 2019


yvvan marked an inline comment as done.
yvvan added inline comments.


================
Comment at: clang/include/clang/Tooling/ReplacementsYaml.h:35
+        : FilePath(""), Offset(0), Length(0), ReplacementText("") {
+      size_t lineBreakPos = ReplacementText.find('\n');
+      while (lineBreakPos != std::string::npos) {
----------------
gribozavr wrote:
> yvvan wrote:
> > gribozavr wrote:
> > > Sorry, I don't understand how this works -- ReplacementText does not contain a \n, so lineBreakPos will be npos, and the loop below will not execute...
> > Quite opposite. This patch targets the cases where it's not npos (see the test example). So it has a line break and this line break should be transformed into two line breaks.
> What I'm saying that in this constructor RelpcamentText is an empty string, always, and therefore it does not contain a \n.
Ah, yes, my fault. I've generated the wrong diff. Thanks, will update it soon.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63482/new/

https://reviews.llvm.org/D63482





More information about the cfe-commits mailing list