[clang-tools-extra] [clang-tidy] Add `llvm-formatv-string` (PR #195974)
via cfe-commits
cfe-commits at lists.llvm.org
Tue May 5 18:45:00 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE LINT COMMENT: clang-tidy-->
:warning: C/C++ code linter, clang-tidy found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
```bash
git diff -U0 origin/main...HEAD -- clang-tools-extra/clang-tidy/llvm/FormatvStringCheck.cpp clang-tools-extra/clang-tidy/llvm/FormatvStringCheck.h clang-tools-extra/clang-tidy/llvm/LLVMTidyModule.cpp |
python3 clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py -path build -p1 -quiet
```
</details>
<details>
<summary>
View the output from clang-tidy here.
</summary>
```
clang-tools-extra/clang-tidy/llvm/FormatvStringCheck.cpp:56:5: warning: variable 'Content' of type 'llvm::StringRef' can be declared 'const' [misc-const-correctness]
56 | llvm::StringRef Content = Fmt.substr(1, CloseBrace - 1);
| ^
| const
clang-tools-extra/clang-tidy/llvm/FormatvStringCheck.cpp:162:3: warning: variable 'FmtStr' of type 'llvm::StringRef' can be declared 'const' [misc-const-correctness]
162 | llvm::StringRef FmtStr = FmtLiteral->getString();
| ^
| const
clang-tools-extra/clang-tidy/llvm/FormatvStringCheck.cpp:187:10: warning: variable 'Index' of type 'unsigned int' can be declared 'const' [misc-const-correctness]
187 | for (unsigned Index : Parsed.Indices)
| ^
| const
```
</details>
https://github.com/llvm/llvm-project/pull/195974
More information about the cfe-commits
mailing list