<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/85550>85550</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-19 returns true for `__is_literal_type` on union with non trivial member with C++-23+
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AMS21
</td>
</tr>
</table>
<pre>
Given the following code
```cpp
struct non_trivial {
~non_trivial();
};
union non_trivial_union {
int i;
non_trivial n;
};
static_assert(!__is_literal_type(non_trivial), "");
static_assert(!__is_literal_type(non_trivial_union), "");
```
clang-18.1.0 compiles fine while clang-19 fails the second `static_assert`.
[godbolt](https://godbolt.org/z/hPj9cGqhb)
Note that this does not happen in C++-20 mode [godbolt](https://godbolt.org/z/v94aM5fTj)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU02PozgQ_TXFpZTIFF_hwKHTUfrUq5V275GBSnDL2KxtEvUe5rePgEw-ZjQjtWQZVGW_elXvWXqvToa5gmwL2S6SY-isq17e_6E4qm37Wb2pMxsMHePRam0vypywsS2D2IF4ue65WFYzDEvEBzc2AY01h-DUWUmNUGyXHH57CANtgEpIrjkodvf_eR-NsuYR6LBE7nCIqExAdbv4VNb8AdsHGVRzkN6zCzOT-HBQ_qBVYCf1IXwODLR5olsCvSIQzetO_OtQSx-_BbzN9JFwo6U5reLNOl4LbGw_KM0ej8owXjqlGa8HSjxKpf0sm-fGmhYhF88cc7F-0jDbnmxbWx0g2wFtuhAGD8kL0B5of02trTsB7f8H2nd_f5TN239dPZF-wPnLBsbQyYChUx5byx6NDdjJYWCDyuAr0BZouyKBvW0Zv1r5XKbyPTv--wFURm2VtGVSyoiruIhFHpdlIaKuiqksORZtkaRMWdwUGR2Lso7zomEhijpSFQlKRRLnJGLKxDoVeZof2zpJ641IcoJUcC-VXmt97qfykfJ-5GqTZZmItKxZ-_nZEBm-4JycNMx2kaumO6t6PHlIhVY--DtKUEFzdRPKcRid8RjcOD0xNwn1q3Nygdbg4vyLCt1kcfxh8Z77mt0Svw03AdpGo9PVT-NUoRvrdWN7oP3E6fpZDc5-cBOA9nMnHmg_d_o9AAD__64XQ3M">