[clang-tools-extra] [clang-tidy][false-positive] misc-const-correctness warns for expression dependent on pack expansion (PR #245347)

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 23 17:51:19 PST 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/misc/ConstCorrectnessCheck.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/misc/ConstCorrectnessCheck.cpp:332:7: warning: nested 'if' statements can be merged together [readability-redundant-nested-if]
  332 |       if (const FunctionDecl *Pattern =
      |       ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  333 |               DeclaringFunction->getTemplateInstantiationPattern())
      |               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  334 |         if ((PatternBody = Pattern->getBody(PatternFunction)))
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  335 |           PatternVariable =
clang-tools-extra/clang-tidy/misc/ConstCorrectnessCheck.cpp:334:9: note: nested 'if' statement to merge declared here
  334 |         if ((PatternBody = Pattern->getBody(PatternFunction)))
      |         ^
```

</details>


https://github.com/llvm/llvm-project/pull/245347


More information about the cfe-commits mailing list