madsravn added inline comments.
================ Comment at: clang-tidy/modernize/ReplaceRandomShuffleCheck.cpp:81 + Stream << "shuffle("; + FirstArgument->printPretty(Stream, nullptr, Ctx.getPrintingPolicy()); + Stream << ", "; ---------------- xazax.hun wrote: > madsravn wrote: > > xazax.hun wrote: > > > madsravn wrote: > > > > xazax.hun wrote: > > > > > Wouldn't just using the original source range of the argument work? > > > > > What about preserving the comments next to the arguments? > > > > I am not sure what you mean about the original source range. Can I just > > > > put that onto the Stream? > > > > > > > > Do you have an idea for the comments? Do you mean something like > > > > > > > > > > > > ``` > > > > std::random_shuffle( > > > > vec.begin(), // Comment > > > > vec.end() // Comment > > > > ); > > > > ``` > > > Or even: > > > > > > > > > ``` > > > std::random_shuffle(vec.begin(), /*inlinecomment*/ vec.end()); > > > ``` > > Thanks for you other comments. Can you elaborate on how I might fix this? > You might do a different strategy, like not touching the arguments at all, > but only inserting a new argument before the closing paren of the function > call. This way all the comments should be preserved. I could try that. So just change the name of the function, random_shuffle to shuffle, and then remove the third argument if present and insert third argument. I guess it will work, but it will make the code less elegant. https://reviews.llvm.org/D30158 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits