<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/65500>65500</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Empty BitVector call getData() got "Assertion `idx < size()' failed."
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
wingrez
</td>
</tr>
</table>
<pre>
I migrated my project from llvm12.0 to llvm15.0 and found a problem. It worked fine in version 12.0, but in version 15.0 it got an assertion failure.
This is a reproduct code snippet:
```cpp
BitVector bv;
auto d = bv.getData();
std::cout << d.size() << std::endl;
```
I expect it to work.
This problem still occurs in recent versions of llvm. I'm not sure it's a reasonable behavior for an empty BitVector.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkk02PozwMxz-NuViDQnhpOXCYmT6Ven-090AMzW5IUGI6L59-Fdphd7QSAuTYlv37_6NiNJMj6qB-gfqUqZWvPnRvxk2BPrPe64_ugrOZgmLSOH_gEvxPGhjH4Ge09jYXMhfI_v5f5wKV0zj61WlUKbu3NOd4YXzz4RdpHI0jNA5vFKLxDlM9yFfsV_4WTq0M4-QZlUMVIwVOB6Mydg2UgziBeL6__7-aiCaiwkBL8HodGAevCaMzy0IM5SMRGnF_hmW5R14M_6CBfcD-BuXLPahW9qgRyhP2t3wiPilWII8g2z0nsk5ty-fBr4xQvkL5ijqP5pPumV-xPZGctnv5Psnfe1yQ3pdE13BCmoj9u-eDKUY21qIfhjXERC7QQI6_AEb046ZJjheQhxmdZ4xrIDQM8nBnpaJ3qreEPV3VzfiAow8JN80Lf-DOJs90V-q2bFVGXdG0lShaUVXZtSuOIzWVKtpCjX1_0EdJpWpUNerieBjqKjOdFLIUrWiKphZVlRdSt4qo7GtdlKNUUAmalbH5NqwPU2ZiXKlr6lqIzKqebNzsKaWjN9wOQcrk1tClmqd-nSJUwprI8U8XNmyp--_7Ijgoa_GboJvDQMrn3WHQCKPfcdNuVxPkYbMe6RykzNZguyvzEpO08gzyPBm-rn0--BnkOU3x-Dw9bgzI8zZ7BHnedvsdAAD__1PTGCI">