<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57787>57787</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang 15: invalid application of 'sizeof' to incomplete type 'llvm::MemoryBuffer'
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
tedyu
</td>
</tr>
</table>
<pre>
From https://bugzilla.redhat.com/show_bug.cgi?id=2127503
```
/usr/include/c++/12/bits/unique_ptr.h: In instantiation of 'void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = llvm::MemoryBuffer]':
/usr/include/c++/12/bits/unique_ptr.h:396:17: required from 'std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = llvm::MemoryBuffer; _Dp = std::default_delete<llvm::MemoryBuffer>]'
/usr/include/llvm/Support/ErrorOr.h:142:34: required from 'llvm::ErrorOr<T>::~ErrorOr() [with T = std::unique_ptr<llvm::MemoryBuffer>]'
llvmjit_inline.cpp:771:35: required from here
/usr/include/c++/12/bits/unique_ptr.h:93:23: error: invalid application of 'sizeof' to incomplete type 'llvm::MemoryBuffer'
93 | static_assert(sizeof(_Tp)>0,
| ^~~~~~~~~~~
```
It seems LLVM API needs some adjustment.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy1VNtu4yAQ_Rr8gtayIQ7xgx-SJpEqtdqVttrXiJhxTEWMC7hV-vU75NIkUrOqVC0imDDM5ZwZZm3Vrlo6u6VtCL0nfErYEud62LxrY2TqQLUypLXd4qlv7dsKRWm90YQvtSJ8znImioxTks1JNiXj7DgPf9ly8A5X3dVmUIC7mrDZfi5zFh3p4OOtTr8MsOqDS1sMgt53VHc-yC5oGbTtqG0oYeLVakV9UDFOPlXQyMGElQIDAQi_Wz31hC8OQtuDk8Gi8wlhJa5RyDCiktYWTVNSzN50aCmeU8RBjXndHlQfYWvdbjY0DThSzNFvPP8WIF6Occ2jIUqpg5dBI7O0icyj_Q9IZ7UjHHZHV_MzKiIWF1f20L4KhM-ipf2N2wze0l0cebhFwl6PLX8PfW9dwN3COet-HsDnIxYpGN0Af_Z5VMI4ni4Rn46v4T5dQ7li7ksw4qVnHVa6M7qDtO6R5qkQeYy1-CzWFhx8rwxKjguLC4UIKm509yoNlrXse6Pry2r3-h1sgxsaLF7DN9jHNNGw6-GauCuUJ3wYf4nvUtzR08AHFXS9kt5DTNLk5ODwNkrkJ8OC-9DGcal9PUixwNT8a37WEO4D9QBbTx8e_jzS6a972gEoT73dApXqefBhC11IE6jy8ZjzEZ8wlqiKq5KXMgk6GKhqI7sNzYv_xF4yOFNdt8MNFtywPnbBY63Hz4_e2WeoY8Fr7weIKS-EmIikrUqhBJMjWJcADZMN_kpVN2vsllmZc5EYuQbjK6xnrMpEVyxjDCXjvChExtJCqHokFB-XTIzKsSCjDLZSmzQ6Tq3bJK7ax4AN2aPQaB_8WYhJ1hsk92RfDqG1rgqgdkOyD7baR_oX9BjPdQ">