<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57788>57788</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Bug when using std::vector in constexpr context
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          gergol
      </td>
    </tr>
</table>

<pre>
    The following code compiles with gcc and MSVC, but not with clang 15 and latest trunk. It seems to miss the deallocations and reports an error. 

```
#include <array>
#include <vector>

consteval void foo(auto func) {
    std::array<int, func().size()> f;
}

int main() {
    foo([](){ return std::vector<int>{1,2,3,4,5};});
}

```

[Compiler explorer](https://godbolt.org/z/PadTK7cEE)
[Question on SO](https://stackoverflow.com/questions/73748978/compiler-disagreement-on-using-stdvector-in-constexpr-context)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtU9tunDAQ_RrzMgKBWTA88JDdJFJVVW2Vqu8GBtaN197aZjfJ13e4pGmjIHsYM5dzZjy0tn9ufhwRBqu1vSozQmd7JHE6K40eriocYew6kKaHLw8_D4wfoJ0CGBtWY6clRWXF4qFlQB8guMk8JvApgEc8eQgWTsrTm5B6lATVyaCs8UuQw7N1YdYBnbMuAZbesvRmk2W6rfXIc2U6PRFJlh-kc_KZ5Xcf2S7YBevejIvsCDTgRWq4WNVT2ZbxSk5EcJhMx3gNTOxXV6DHh57lN7Q2oIMyYe7A6lyRf-LVC64qQcHA8i2cidt_gSkQTlKZ1fV_lJUFK_asuN1SiT21JUzOvFF4rWfhQFWJfUZUOO2c9o52MWMSPsmZzcdE3vdzlcX-sF65A3w6a-vQrWSOIZz9TIDf0xpt31odEutGOr3Q_ib7H59Fd3c3Q77m-j7RFND9Aq2Hrx8l8kF2j_aCbqCxS2jc6NvvLcqTLnKxq2pBvbjfZtHFvfJydDRQaEJsTTx5mteY-rN2JlYmXq_36exmjRS6rDrCJivLPC8qIbKob_K-zmsZBRU0NvtphOsRDSzJ3jcblIG_KWFLGU1ON-_aQj_C1G5laH15fcVnZ39RJjrS-FN5pBRCVFV0bNqsGrDsBiHLvBSpwKroBS9lLqqiLnoZadmi9s08FpwbvMKSgnTqZ6QannKe1lnJ07TM0mTXYiEFRy66XT6ULdulSPOmk5nHfF-RaxZK7TR6Mmrlg38zSu_VaBCbdQoj-iWO1jUjutHqaEFuFuZ_ALnpR_E">