<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62858>62858</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang] Clang accepts deleted constructer for no_unique_address field.
</td>
</tr>
<tr>
<th>Labels</th>
<td>
c++20,
accepts-invalid
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
usx95
</td>
</tr>
</table>
<pre>
GCC test: `g++.dg/cpp2a/no_unique_address7.C`
```
struct A { A(const A&) = delete; };
A f();
struct C
{
[[no_unique_address]] A a;
};
C c{f()};
```
Clang accepts while GCC rejects this.
https://godbolt.org/z/6rc8MoKPY
I am not completely sure whether we should reject this code or this is a bug in gcc.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxkUstunDAU_ZrL5irIc3nOggUPUVVVpW67ioztAVcePLVN0vTrKzM0TRMJgX2Bc3we3Hs9r0o1UHRQDAnfwmJds_lf5yKZrHxpPvU9BuUDZC1CyWagDqhL5Qw0ituNONC42sdt1T839cildMr7Ku2hZMAGYG1c3K9964PbRMAWoeqwBaqFXX2IqxLojJANKJVRQUHWIVQDZN39xxYvQDXQ-XVyQPUHT3WMEXcx3YdTQTFAMWCL_BXiLUGPAqruL8mbF-8U9IavM3Ih1C14fF60URhdcuqHEsFjWLRP758uIdw8ZC3QCDTOVk7WhNS6aN5voLF0ov5qv3z7fhDt98_Ir7jagMJeb9EJ84J-cwqfFxUW5fBZoV_sZuRBuTOisFKhdfeN9shx2mbUK85CHMdJZJPJc3bmiWpOZZ1XRVVlRbI0gk8kT_xCNZ9YnlPGhZqE4KWY6MJEnuiGGGWsIDrRqchYmhMTWV3WXJy4ZFxAztSVa5Ma83SNChPt_aaakuqiTgyflPF7yYjEvULEgAioB6LDywe9PnGjZZwXQ-KaiPUwbbOHnBntg_-HHnQwe2tFTCPG-n8s9w5J3NsVa6IcXqzDD6XAi1ZGpsnmTPMuLh2WbUqFvQKNkfh4PNycjbYDjbtGH4OMMv8EAAD__6uv_rw">