[clang-tools-extra] 4589bf9 - [clang-tidy] Fix modernize-use-std-format lit test signature (#102759)

via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 11 06:03:43 PDT 2024


Author: Mike Crowe
Date: 2024-08-11T21:03:40+08:00
New Revision: 4589bf90aa1849b3851945fb611f5c96af821332

URL: https://github.com/llvm/llvm-project/commit/4589bf90aa1849b3851945fb611f5c96af821332
DIFF: https://github.com/llvm/llvm-project/commit/4589bf90aa1849b3851945fb611f5c96af821332.diff

LOG: [clang-tidy] Fix modernize-use-std-format lit test signature (#102759)

My fix for my original fix of issue #92896 in
666d224248707f373577b5b049b5b0229100006c modified the function signature
for fmt::sprintf to more accurately match the real implementation in
libfmt but failed to do the same for absl::StrFormat. The latter fix
applied equally well to absl::StrFormat so it's important that its test
verifies that the bug is fixed too.

Added: 
    

Modified: 
    clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format.cpp b/clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format.cpp
index e8dea1dce2c972..800a95062e8f1a 100644
--- a/clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format.cpp
+++ b/clang-tools-extra/test/clang-tidy/checkers/modernize/use-std-format.cpp
@@ -11,9 +11,8 @@
 
 namespace absl
 {
-// Use const char * for the format since the real type is hard to mock up.
-template <typename... Args>
-std::string StrFormat(const char *format, const Args&... args);
+template <typename S, typename... Args>
+std::string StrFormat(const S &format, const Args&... args);
 } // namespace absl
 
 template <typename T>


        


More information about the cfe-commits mailing list