[clang-tools-extra] [clang-tidy] modernize-return-braced-init-list: skip types with an initializer_list constructor (PR #205440)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 23 14:54:13 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/misc/ExplicitConstructorCheck.cpp clang-tools-extra/clang-tidy/modernize/ReturnBracedInitListCheck.cpp clang-tools-extra/clang-tidy/utils/TypeTraits.cpp clang-tools-extra/clang-tidy/utils/TypeTraits.h |
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/modernize/ReturnBracedInitListCheck.cpp:22:6: warning: function 'hasInitListConstructor' is declared in an anonymous namespace; prefer using 'static' for restricting visibility [llvm-prefer-static-over-anonymous-namespace]
   22 | bool hasInitListConstructor(const CXXRecordDecl *RD) {
      |      ^
```

</details>


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


More information about the cfe-commits mailing list