Issue 169677
Summary [clang-tidy] cppcoreguidelines-pro-type-member-init check flags local variables of std::array<> type
Labels clang-tidy
Assignees
Reporter avaneyev
    `cppcoreguidelines-pro-type-member-init ` flags local `std::array<>` variables as uninitialized. This seems wrong, as these aren't members of a structure or class, where the check should be applied.
Setting the `IgnoreArrays` config parameter to true does not help. Not sure if this case was supposed to be covered by the `IgnoreArrays` param in the first place, or this is just a bug.

Example program:
```
include <array>

void func() {
    std::array<char, 10> someArray;
 someArray.fill('n');
}
```
which produces the following warning and a fix suggestion:
```
<source>:4:5: warning: uninitialized record type: 'someArray' [cppcoreguidelines-pro-type-member-init]
    4 | std::array<char, 10> someArray;
      |     ^                             
 |                                   {}
1 warning generated.
```
(on godbolt: https://godbolt.org/z/rY9zPv7hG).


_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to