<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/61232>61232</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc++] `std::declval` gives wrong result for `cv void`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc++
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
fsb4000
</td>
</tr>
</table>
<pre>
@frederick-vs-ja found that `std::declval` works wrongly for the code example:
```c++
#include <utility>
#include <type_traits>
int main() {
static_assert(std::is_same_v<decltype(std::declval<const void>), const void () noexcept>);
static_assert(std::is_same_v<decltype(std::declval<volatile void>), volatile void () noexcept>);
}
```
https://gcc.godbolt.org/z/rc483sWPo
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysU09voz4Q_TTDxUpkxgTIgUOb_Dj_bnuMjD0Qtw6O7IE2--lX0HTbrXa1l5WsQZp_b97MQ6fkhpGogd0j7I6ZnvgcYtOnrpBSZl2wtwYK2UeyFJ153sxp86RFH6bRCj5rFlDKxBbUA6gHS8bP2kMpxUuIz0m8xDAO_ib6EAWfSZhgSdCrvlw9LSXyCPLdlvLtGcDH5b15UbnR-MmSAHWY2HnHN1D__S7KtyudOGrH6SNjtW5kcdFuBKwB9wKqe3eRWLMzJ50SRQasfzJx6ZT0hU4zqMPCaun9Of7OVB1MGBOLOTi7gOIe8CA-fOIOOQZ6NXTle476hwPMwWt2nr7M8Iv7L2NAdfxyhM_bOzNf04KKLWA7GLMdgu2C522IA2D7HbCNpqhV-vZ_yGyj7F7tdUZNXlZ1Xu53WGbnpsC-NkVtqpyUliRV3VfSVqbKNfXFvshcgxKVVLKSZY6y3KoiN7rqKlRa9VJaKCRdtPNb7-fLgp25lCZqyhwVZl535NOqY0TvuncZIS66js1StOmmIUEhvUucPtqwY7_-AZ_Kdsc_KXtwM92VLSKlyfMq70W589sNSplN0Tdf9ub4PHVbEy6A7QJ9_2yuMTyRYcB2pZMA25XRjwAAAP__LU4X1g">