[PATCH] D154283: [clang-tidy] Fix width/precision argument order in modernize-use-std-print

Mike Crowe via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 2 07:57:05 PDT 2023


mikecrowe added a comment.

Thanks for the review.



================
Comment at: clang-tools-extra/clang-tidy/utils/FormatStringConverter.cpp:356-357
+  if (ArgCount)
+    ArgRotates.push_back(
+        std::make_tuple(FS.getArgIndex() + ArgsOffset, ArgCount));
+}
----------------
PiotrZSL wrote:
> 
Good point.


================
Comment at: clang-tools-extra/clang-tidy/utils/FormatStringConverter.h:73
+  // puts the width and preicision first.
+  std::vector<std::tuple<unsigned, unsigned>> ArgRotates;
+
----------------
PiotrZSL wrote:
> NOTE: You can use std::pair here.
True, but in my mind `std::pair` only exists because `std::tuple` couldn't be implemented in the C++98.

I was going to change it to use `std::pair` anyway, but I notice that I already use `std::tuple` for `ArgFixes` just above. Should I change both of them?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154283



More information about the cfe-commits mailing list