[clang-tools-extra] [docs][clang-tidy] Correct StrictMode example in modernize-use-std-print (PR #108805)

2024-09-17 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe commented: LGTM. Thanks for fixing this. https://github.com/llvm/llvm-project/pull/108805 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [docs][clang-tidy] Correct StrictMode example in modernize-use-std-print (PR #108805)

2024-09-16 Thread Mike Crowe via cfe-commits
mikecrowe wrote: Thanks for fixing this @MainakSil. I wasn't aware of the bug report until now. @nicovank is correct that only the format string needs to change as I got the format specifiers the wrong way round originally. Thanks for adding me to this change. I copied the same mistake to `us

[clang-tools-extra] [clang-tidy] Support member functions with modernize-use-std-print/format (PR #104675)

2024-08-17 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/104675 >From afdd6c2a12735e1da69a46c6ff78b5d4e0dcdb6e Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 21 Jul 2024 20:37:02 +0100 Subject: [PATCH 1/2] [clang-tidy] Support member functions with modernize-use-std

[clang-tools-extra] [clang-tidy] Support member functions with modernize-use-std-print/format (PR #104675)

2024-08-17 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe created https://github.com/llvm/llvm-project/pull/104675 These checks can be made to work on member functions quite easily and it's not unknown to have at least printf-style functions as members. Let's remove the restriction. >From afdd6c2a12735e1da69a46c6ff78b5d4

[clang-tools-extra] [clang-tidy] Correct typo in ReleaseNotes.rst (PR #104674)

2024-08-17 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe created https://github.com/llvm/llvm-project/pull/104674 None >From b96dfbca33c5beb5ca3c984bc9388d11f0d7f707 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sat, 17 Aug 2024 17:04:06 +0100 Subject: [PATCH] [clang-tidy] Correct typo in ReleaseNotes.rst --- clang-t

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

2024-08-11 Thread Mike Crowe via cfe-commits
mikecrowe wrote: Thanks for the reviews. Please can someone land this for me when convenient? https://github.com/llvm/llvm-project/pull/102759 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

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

2024-08-10 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe created https://github.com/llvm/llvm-project/pull/102759 My fix for my original fix of issue #92896 in 666d224248707f373577b5b049b5b022916c modified the function signature for fmt::sprintf to more accurately match the real implementation in libfmt but failed to

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-28 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/97911 >From 71dedefaf4dd8725b9a94e50c8f4d43b0e8bc4b2 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Wed, 12 Jun 2024 21:06:26 +0100 Subject: [PATCH] [clang-tidy] Only expand macros in modernize-use-std-format/prin

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-28 Thread Mike Crowe via cfe-commits
mikecrowe wrote: @5chmidti wrote: > Looks good from my side Thanks. I've squashed and rebased. Since 19 has been branched now and it includes *modernize-use-std-format* I've mentioned the improvement as being for both *modernize-use-std-print* and *modernize-use-std-format* in the release not

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-28 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/97911 >From f7be65b1581e49bb18b3ab613686daedcd71b4d9 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Wed, 12 Jun 2024 21:06:26 +0100 Subject: [PATCH] [clang-tidy] Only expand macros in modernize-use-std-format/prin

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-27 Thread Mike Crowe via cfe-commits
mikecrowe wrote: @5chmidti wrote: > It'll be 1 week+ before I am back at my main machine to take a better look at > the macro question. Maybe this can just be landed, without that distinction. Thanks for letting me know and thanks for the review. I've pushed a new version to this PR with the t

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-27 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/97911 >From f6c1a231681092189a621e2bc6af97300b2a7bfa Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Wed, 12 Jun 2024 21:06:26 +0100 Subject: [PATCH 1/6] [clang-tidy] Only expand macros in modernize-use-std-format/

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-21 Thread Mike Crowe via cfe-commits
mikecrowe wrote: @5chmidti wrote: > It should be possible to detect this case comparing the FileID of the call's > location and the format expression's location. If they differ, then they are > different arguments -> different macros. Although, I haven't checked that yet. I had thought so too

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-21 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/97911 >From f6c1a231681092189a621e2bc6af97300b2a7bfa Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Wed, 12 Jun 2024 21:06:26 +0100 Subject: [PATCH 1/6] [clang-tidy] Only expand macros in modernize-use-std-format/

[clang-tools-extra] [clang-tidy] Fix modernize-use-std-print/format for fmt (PR #99021)

2024-07-16 Thread Mike Crowe via cfe-commits
mikecrowe wrote: The previous fix hadn't made it into a release yet, so I don't think that this newly-discovered problem requires mentioning in the release notes. I'm happy to create a separate issue for it if you'd like me to though. https://github.com/llvm/llvm-project/pull/99021 ___

[clang-tools-extra] [clang-tidy] Fix modernize-use-std-print/format for fmt (PR #99021)

2024-07-16 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe created https://github.com/llvm/llvm-project/pull/99021 When fixing #92896 in 0e62d5cf55479981da5e05e406bbca4afb3cdc4f (#94104) I failed to spot that I'd broken converting from fmt::printf, fmt::fprintf and fmt::sprintf in these checks since the format parameter of

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-14 Thread Mike Crowe via cfe-commits
mikecrowe wrote: > Unfortunately, walking the format string looking for macros also seems to > match a macro that encloses the whole function invocation. This results in > the check failing to work on expressions inside Catch2 `REQUIRE` macros for > example. > > My new test case (that current

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-14 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/97911 >From f6c1a231681092189a621e2bc6af97300b2a7bfa Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Wed, 12 Jun 2024 21:06:26 +0100 Subject: [PATCH 1/4] [clang-tidy] Only expand macros in modernize-use-std-format/

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-11 Thread Mike Crowe via cfe-commits
mikecrowe wrote: Unfortunately, walking the format string looking for macros also seems to match a macro that encloses the whole function invocation. This results in the check failing to work on expressions inside Catch2 `REQUIRE` macros for example. My new test case (that currently fails) is:

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-09 Thread Mike Crowe via cfe-commits
@@ -230,6 +241,37 @@ FormatStringConverter::FormatStringConverter(ASTContext *ContextIn, finalizeFormatText(); } +std::optional +FormatStringConverter::formatStringContainsUnreplaceableMacro( +const StringLiteral *FormatExpr, SourceManager &SM, Preprocessor &PP) { + fo

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-07 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe edited https://github.com/llvm/llvm-project/pull/97911 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-07 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/97911 >From f6c1a231681092189a621e2bc6af97300b2a7bfa Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Wed, 12 Jun 2024 21:06:26 +0100 Subject: [PATCH 1/3] [clang-tidy] Only expand macros in modernize-use-std-format/

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-07 Thread Mike Crowe via cfe-commits
mikecrowe wrote: It looks like the tests are failing on Windows because the `%s` in the command line ``` // RUN: %check_clang_tidy \ // RUN: -std=c++20 %s modernize-use-std-format %t -- \ // RUN: -config="{CheckOptions: {StrictMode: true}}" \ // RUN: -- -isystem %clang_tidy_headers \ // RU

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-07 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/97911 >From f6c1a231681092189a621e2bc6af97300b2a7bfa Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Wed, 12 Jun 2024 21:06:26 +0100 Subject: [PATCH 1/2] [clang-tidy] Only expand macros in modernize-use-std-format/

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-06 Thread Mike Crowe via cfe-commits
mikecrowe wrote: I'm not particularly happy with the `FormatStringConverter` constructor now taking seven parameters. The risk of them getting muddled isn't huge though because they are all of different types. Should I perhaps put them all into the `FormatStringConverter::Configuration` struct

[clang-tools-extra] [clang-tidy] Only expand macros in modernize-use-std-format/print (PR #97911)

2024-07-06 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe created https://github.com/llvm/llvm-project/pull/97911 Expanding all macros in the printf/absl::StrFormat format string before conversion could easily break code if those macros are expended to change their definition between builds. It's important for this check

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-03 Thread Mike Crowe via cfe-commits
mikecrowe wrote: Thank you @PiotrZSL! https://github.com/llvm/llvm-project/pull/94104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-03 Thread Mike Crowe via cfe-commits
mikecrowe wrote: > LGTM Thanks for the review. Please can you squash and land it for me? I don't have permission to do so. https://github.com/llvm/llvm-project/pull/94104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-03 Thread Mike Crowe via cfe-commits
@@ -351,6 +351,10 @@ Changes in existing checks ` check to also handle calls to ``compare`` method. +- Improved :doc:`modernize-use-std-format` and mikecrowe wrote: I spotted that just too late... https://github.com/llvm/llvm-project/pull/94104 _

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-03 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/94104 >From 2972062997ca582100b5797cd548c4dc2f80c69a Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 31 May 2024 21:27:03 +0100 Subject: [PATCH 1/3] [clang-tidy] Fix assert in modernize-use-std-format/print Ens

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-03 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/94104 >From 2972062997ca582100b5797cd548c4dc2f80c69a Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 31 May 2024 21:27:03 +0100 Subject: [PATCH 1/3] [clang-tidy] Fix assert in modernize-use-std-format/print Ens

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-03 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/94104 >From 2972062997ca582100b5797cd548c4dc2f80c69a Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 31 May 2024 21:27:03 +0100 Subject: [PATCH 1/3] [clang-tidy] Fix assert in modernize-use-std-format/print Ens

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-03 Thread Mike Crowe via cfe-commits
@@ -20,6 +20,11 @@ namespace clang::tidy::modernize { namespace { AST_MATCHER(StringLiteral, isOrdinary) { return Node.isOrdinary(); } +AST_MATCHER(QualType, isSimpleChar) { + const auto ActualType = Node.getTypePtr(); + return ActualType->isSpecificBuiltinType(BuiltinType::

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-01 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe edited https://github.com/llvm/llvm-project/pull/94104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (PR #94104)

2024-06-01 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe edited https://github.com/llvm/llvm-project/pull/94104 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (#92896) (PR #94104)

2024-06-01 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/94104 >From 2972062997ca582100b5797cd548c4dc2f80c69a Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 31 May 2024 21:27:03 +0100 Subject: [PATCH] [clang-tidy] Fix assert in modernize-use-std-format/print Ensure

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (#92896) (PR #94104)

2024-06-01 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/94104 >From 54135a6f8fd9491e6b94e4d96e46f2909e344307 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 31 May 2024 21:27:03 +0100 Subject: [PATCH] [clang-tidy] Fix assert in modernize-use-std-format/print (#92896

[clang-tools-extra] [clang-tidy] Fix assert in modernize-use-std-format/print (#92896) (PR #94104)

2024-06-01 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe created https://github.com/llvm/llvm-project/pull/94104 Ensure that FormatStringConverter's constructor fails with a sensible error message rather than asserting if the format string is not a narrow string literal. Also, ensure that we don't even get that far in m

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-11 Thread Mike Crowe via cfe-commits
mikecrowe wrote: @PiotrZSL wrote: > Once build will pass, I will land this change, and fixes could be done in > separate PR for both checks. The build seems to be passing. Please can you land this if you are happy? Thanks. https://github.com/llvm/llvm-project/pull/90397 __

[clang-tools-extra] [clang-tidy][docs] Fix modernize-use-std-print docs (PR #91069)

2024-05-05 Thread Mike Crowe via cfe-commits
mikecrowe wrote: @5chmidti wrote: > LGTM, thanks Please can you land this for me since I don't have permission to do so myself? (Assuming you do have permission.) Thanks. https://github.com/llvm/llvm-project/pull/91069 ___ cfe-commits mailing list c

[clang-tools-extra] [clang-tidy][docs] Fix modernize-use-std-print docs (PR #91069)

2024-05-05 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/91069 >From 442cc7464ea4972d25e6fe518ac466b540a399eb Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sat, 4 May 2024 17:21:02 +0100 Subject: [PATCH] [clang-tidy][docs] Fix modernize-use-std-print docs The set of fun

[clang-tools-extra] [clang-tidy] Improve modernize-use-std-print diagnostic (PR #91071)

2024-05-05 Thread Mike Crowe via cfe-commits
mikecrowe wrote: @5chmidti wrote: > LGTM, thanks Please can you land this for me since I don't have permission to do so myself? (Assuming you do have permission.) Thanks. https://github.com/llvm/llvm-project/pull/91071 ___ cfe-commits mailing list c

[clang-tools-extra] [clang-tidy] Improve modernize-use-std-print diagnostic (PR #91071)

2024-05-05 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/91071 >From d25fa679a70947d42fe3125858741508475d67c0 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sat, 4 May 2024 17:41:37 +0100 Subject: [PATCH] [clang-tidy] Improve modernize-use-std-print diagnostic Include th

[clang-tools-extra] [clang-tidy] Improve modernize-use-std-print diagnostic (PR #91071)

2024-05-04 Thread Mike Crowe via cfe-commits
mikecrowe wrote: As suggested by @5chmidti in https://github.com/llvm/llvm-project/pull/90397/files/54c325d7a5e24441adbe8036800a2f50e2ff5fa0#r1589445886 . https://github.com/llvm/llvm-project/pull/91071 ___ cfe-commits mailing list cfe-commits@lists.

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Improve modernize-use-std-print diagnostic (PR #91071)

2024-05-04 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe created https://github.com/llvm/llvm-project/pull/91071 Include the source range of the printf function in the diagnostic so it gets underlined in the output. >From d0ccc6ade357155161977446b64c50cafa100edb Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sat, 4 May

[clang-tools-extra] [clang-tidy][docs] Fix modernize-use-std-print docs (PR #91069)

2024-05-04 Thread Mike Crowe via cfe-commits
mikecrowe wrote: The equivalent mistake was spotted by @5chmidti in https://github.com/llvm/llvm-project/pull/90397/files/54c325d7a5e24441adbe8036800a2f50e2ff5fa0#r1589697782 in the new use-std-format check. https://github.com/llvm/llvm-project/pull/91069 __

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration op

[clang-tools-extra] [clang-tidy][docs] Fix modernize-use-std-print docs (PR #91069)

2024-05-04 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe created https://github.com/llvm/llvm-project/pull/91069 The set of functions for the PrintfLikeFunctions and FprintfLikeFunctions options replaces the default, so remove the word "extra" from the description which implies that they are in addition to the default.

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/90397 >From 0d6ede5d59cc70d803bfe2c7997737c1be358c75 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Apr 2024 12:41:46 +0100 Subject: [PATCH 01/16] [clang-tidy] Add modernize-use-std-format check Add a new c

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
mikecrowe wrote: Thanks! I wasn't aware that was possible since I started with all these checks before fbf611ed2a768999202e2c5e1e1a6c3c6bb94725 and had been battling with the JSON syntax. https://github.com/llvm/llvm-project/pull/90397 ___

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe edited https://github.com/llvm/llvm-project/pull/90397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration op

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-04 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-02 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/90397 >From 0d6ede5d59cc70d803bfe2c7997737c1be358c75 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Apr 2024 12:41:46 +0100 Subject: [PATCH 01/12] [clang-tidy] Add modernize-use-std-format check Add a new c

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-02 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %check_clang_tidy \ +// RUN: -std=c++20 %s modernize-use-std-format %t -- \ +// RUN: -config="{CheckOptions: [{key: StrictMode, value: true}]}" \ +// RUN: -- -isystem %clang_tidy_headers +// RUN: %check_clang_tidy \ +// RUN: -std=c++20 %s moderni

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-02 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,120 @@ +// RUN: %check_clang_tidy \ +// RUN: -std=c++20 %s modernize-use-std-format %t -- \ +// RUN: -config="{CheckOptions: [{key: StrictMode, value: true}]}" \ +// RUN: -- -isystem %clang_tidy_headers +// RUN: %check_clang_tidy \ +// RUN: -std=c++20 %s moderni

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-02 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,84 @@ +.. title:: clang-tidy - modernize-use-std-format + +modernize-use-std-format + + +Converts calls to ``absl::StrFormat``, or other functions via +configuration options, to C++20's ``std::format``, or another function +via a configuration op

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-02 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe edited https://github.com/llvm/llvm-project/pull/90397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-02 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe edited https://github.com/llvm/llvm-project/pull/90397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-02 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe edited https://github.com/llvm/llvm-project/pull/90397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-05-02 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,97 @@ +// RUN: %check_clang_tidy \ +// RUN: -std=c++20 %s modernize-use-std-format %t -- \ +// RUN: -config="{CheckOptions: [{key: StrictMode, value: true}]}" \ +// RUN: -- -isystem %clang_tidy_headers +// RUN: %check_clang_tidy \ +// RUN: -std=c++20 %s moderniz

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-30 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/90397 >From 0d6ede5d59cc70d803bfe2c7997737c1be358c75 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Apr 2024 12:41:46 +0100 Subject: [PATCH 01/11] [clang-tidy] Add modernize-use-std-format check Add a new c

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-30 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/90397 >From 0d6ede5d59cc70d803bfe2c7997737c1be358c75 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Apr 2024 12:41:46 +0100 Subject: [PATCH 01/10] [clang-tidy] Add modernize-use-std-format check Add a new c

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-30 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/90397 >From 0d6ede5d59cc70d803bfe2c7997737c1be358c75 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Apr 2024 12:41:46 +0100 Subject: [PATCH 1/9] [clang-tidy] Add modernize-use-std-format check Add a new cla

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-30 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-29 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe edited https://github.com/llvm/llvm-project/pull/90397 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-29 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,107 @@ +//===--- UseStdFormatCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,108 @@ +//===--- UseStdFormatCheck.cpp - clang-tidy ---===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Mike Crowe via cfe-commits
@@ -0,0 +1,97 @@ +// RUN: %check_clang_tidy \ +// RUN: -std=c++20 %s modernize-use-std-format %t -- \ +// RUN: -config="{CheckOptions: [{key: StrictMode, value: true}]}" \ +// RUN: -- -isystem %clang_tidy_headers +// RUN: %check_clang_tidy \ +// RUN: -std=c++20 %s moderniz

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/90397 >From 0d6ede5d59cc70d803bfe2c7997737c1be358c75 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Apr 2024 12:41:46 +0100 Subject: [PATCH 1/8] [clang-tidy] Add modernize-use-std-format check Add a new cla

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe updated https://github.com/llvm/llvm-project/pull/90397 >From 0d6ede5d59cc70d803bfe2c7997737c1be358c75 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Sun, 28 Apr 2024 12:41:46 +0100 Subject: [PATCH 1/2] [clang-tidy] Add modernize-use-std-format check Add a new cla

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Mike Crowe via cfe-commits
mikecrowe wrote: This check was originally proposed and reviewed at https://reviews.llvm.org/D154287 last year but never landed since I did not (and still do not) have commit access. Near the end of that review, @PiotrZSL wrote: > To be honest, I do not see to much use case for this check. But

[clang-tools-extra] [clang-tidy] Add modernize-use-std-format check (PR #90397)

2024-04-28 Thread Mike Crowe via cfe-commits
https://github.com/mikecrowe created https://github.com/llvm/llvm-project/pull/90397 Add a new clang-tidy check that converts absl::StrFormat (and similar functions) to std::format (and similar functions.) Split the configuration of FormatStringConverter out to a separate Configuration class