<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/68159>68159</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] :bug: `std::vector(size, value)` in `modernize-return-braced-init-list `
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ax3l
</td>
</tr>
</table>
<pre>
## Description
The `clang-tidy` pass `modernize-return-braced-init-list` complains about constructors of `std::vector` that are not initializers lists.
In particular, the constructor
```C++
vector( size_type count,
const T& value,
const Allocator& alloc = Allocator() );
```
should be ignored.
## Versions Affected
Seen with LLVM 14.
## Reproducer
```C++
#include <vector>
std::vector<double>
foo()
{
return std::vector<double>(4, 5);
}
```
https://en.cppreference.com/w/cpp/container/vector/vector
## X-Ref
https://github.com/ECP-WarpX/WarpX/pull/4338
## Keywords
- clang-tidy
- clang-tools-extra
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVE1v4zYQ_TWjCyGDJi1ZOujg2Cug6BYotovt3gqKHFksaFLgR7LJry9oK6mSpsEagmiO3rwZvuGMCEGfLWIH1R1Up0KkODnfiR_cFINTjx0wDoyTEwbp9Ry1s0BPQA-399cJCdRUGmHPZdTqEWpKZhFCtl6cQm_1E5YeY_K2HLyQqEptdSyNDjGDpbvMRmgbiBhcikQ6G6JPMjofiBszT4gK-AH44R6zOXvFSUQiPBLrIsl8Whj9hD6QzBs26xx_sWQWPmqZjPDAjiROuA6zYGt6e47A7vJztS4RWUOCfsK_4uOcXZONwI7rGOTt78pPvgKryb0wCV_w_4M8GOOkuMaqicgbAvy0NjfAWgKsBX73JuPbNkwuGUUGJPpsnUf1SoSljN_QB-1sIIdxRBlRrTF_IFryoONEPn_-9hvZ7t5j-IKzdypJ_FA3YFxbaZJCAvy4qMg_rfneVpUflUuDwRfY6Nzt1IvX_u5fBW8XinzEwZpdLnb1SrKF6fSuglOMc8h8rAfWo93IefY4okcrcSPdBVj_AKyX85zfzkahLXpg_fM1ef7zX9m-l19wXNtfBzvrOKVhifHp-Hv5p_Dzd2D98zonY4D1O86bd9h_xccH51VYfyrJqitfW5wzocQf0YtCdVy1vBUFdtu6rXm9b3bbYupayqp9O1LK9oqqpuaCV-1-xKqlrVI1LXTHKONbSjnbbvdsu6GN2FOuhlEMI21ahB3Fi9BmY8z9ZeP8udAhJOzqZlu1hREDmnCdOoytEmUsTyHfZadySOcAO3pr6ReaqKO5zquVW3UiwA9DOgM_vDcyWJP7N9-HpRvbPEW0_akxlUFF8qb7oGY5u2UpZ-_-RhmB9dcTB2D99dD_BAAA__8Sj5fG">