[clang-tools-extra] [clang-tidy] Do not emit file path for anonymous enums in `readability-enum-initial-value` check (PR #112496)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 16 01:19:13 PDT 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 4ddea298e60c31d0995c06189a592895d2ad512b be0bee7948a8a6394ba93df619d76048847c1ca8 --extensions c,cpp -- clang-tools-extra/clang-tidy/readability/EnumInitialValueCheck.cpp clang-tools-extra/test/clang-tidy/checkers/readability/enum-initial-value.c
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang-tools-extra/clang-tidy/readability/EnumInitialValueCheck.cpp b/clang-tools-extra/clang-tidy/readability/EnumInitialValueCheck.cpp
index 5a48b103b9..9c000df132 100644
--- a/clang-tools-extra/clang-tidy/readability/EnumInitialValueCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/EnumInitialValueCheck.cpp
@@ -170,9 +170,10 @@ void EnumInitialValueCheck::check(const MatchFinder::MatchResult &Result) {
if (const auto *Enum = Result.Nodes.getNodeAs<EnumDecl>("inconsistent")) {
DiagnosticBuilder Diag =
- diag(Enum->getBeginLoc(),
- "initial values in enum '%0' are not consistent, consider explicit "
- "initialization of all, none or only the first enumerator")
+ diag(
+ Enum->getBeginLoc(),
+ "initial values in enum '%0' are not consistent, consider explicit "
+ "initialization of all, none or only the first enumerator")
<< getName(Enum);
for (const EnumConstantDecl *ECD : Enum->enumerators())
if (ECD->getInitExpr() == nullptr) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/112496
More information about the cfe-commits
mailing list