<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56456>56456</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
error when define a move assignment = default (if using type alias)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
TwinKleS-C
</td>
</tr>
</table>
<pre>
For some reason, I used a type alias when defining the move constructor, which compiles successfully on msvc and gcc, but clang doesn't allow it
I tested other special member functions, copy constructor, move constructor, copy assignment function can all use the =default declaration explicitly in the case of using type alias, only move assignment function does not allow this, but it can use =delete explicitly, so is this a bug?
here is my test code
```
// constant reference
template <typename T>
using RC = T const &;
// non-constant reference
template <typename T>
using RV = T &;
// r-value reference
template <typename T>
using RM = T&&;
struct A {
// default constructor
A () = default;
// copy constructor
A (RC<A>) = default;
// move constructor
A (RM<A>) = default;
// copy assignment
auto operator = (RC<A>) -> RV<A> = default;
// move assignment
auto operator = (RM<A>) -> RV<A> = default; // error: only special member functions may be defaulted
//auto operator = (RM<A>) -> RV<A> = delete; // OK
};
int main () {
return 0;
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVV2PmzAQ_DXwskpEIZDwwEMuaaTT6VTpeuq7MUtwZWyETdL8-64h5OtyanSVUIjx7szssF5yXRyyjW7B6BqhRWa08sIVPENnsAAG9tAgMCmYgX2FCgoshRJqC7ZCqPUOgWtlbNtxq1uXua8Er-hh3QiJBkzHORpTdlIeQCuozY4DUwVsOXfheWeBS0aAhUZD3HNLdFLvQVgvWHvB8hksGktiNFGS0Aa5YBJqrHNalp3iVpAEB8Z1c7jVc09jH8eMEVtVo7InEOBMOXZXfF-gF62pYNZJS4WTzJb1YfinkYILSyUJ1QdyRhm6pMTem5Npjk0riutl3KN0ZYPSY9W2Emb0RdhekBPTC5Fo8YLbhRkNwvRJ9K7ybutFm8E1sgrdVn3o7aOSCxx27vwmwfEaluGGrsEzRlJbLAlM8WO-xbqRzDpNK1eoYtQ57170fdgeHHhbOcnwPqCAFyZe9HTFOZAorSb_R_TrSPQpRTvZMdnh19BfB3QH_gF_6ChYgje_5g3SI_XYO5ftN4ZQWrjwwrQnOAZeEKSnt3DT0lf5bytSv3Si_wn04RxcA70-AHRP2rmlT9ussxp0g3RYaLA4sFulE7rTmzs-eUT4wzSvj9LAER7blsyIlsMx_Wy6QM0OkOOYj8WNyi-KcSfaaRnF_Hi5dXu-vuk6QQelZjR2xvY5N1_aou1aBcE5hdKvj7hfZFGRRinzLc0QzPryL0Y7Wf1hVl0Y51jFvTGX-l0rs8raxpCZQzlbYasun9K3gBZS7sbbpGn1b-SWlsKYDil9EyezOPGrDBdFEkbJLCkZj-NiscAgmM_5Io8WvCyCuS9ZjtJkXvzkhaFC-k44CPrvxWtfZGEQhsE8SMMgiL_F03wWLnhRxkWczBnLC28WILknp07HVLdbv816STQ7DW1KYaw5bw4mIPZ0hE-vudJt9r4X6kXiz8nK79mzXv1f7wk56g">