<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/114586>114586</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
C++ constructor interpreted as function when rvalue and using parenthesis, preventing template deduction for aliases
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mld2443
</td>
</tr>
</table>
<pre>
https://godbolt.org/z/fPvqG4Txx
```cpp
template <int> class A {};
A() -> A<0>;
template <int ARG>
using B = A<ARG>;
static_assert(sizeof(B()));
```
GCC deduces `B` to be a type alias for `A` and interprets `B()` as instantiation using deduction guides. clang interprets rvalue as an alias to a function instead of a type constructor, and the template argument deductions are incorrectly rejected.
In order to convince clang that `B` is a type and not a function, we can use braced initialization, `B{}`.
clang and MSVC both consider this ill-formed, however I think GCC is correct here.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsVMFu6zYQ_JrVZRGDImXZPuhgO8_BOxQo2qLXghLXFluaVMmV85KvLygpjlM8QIAhz-7s7HAonZK9eKIG1gdYPxd65D7E5uqMrCpVtMG8NT3zkEDtQZ5Ani7BtMHxKsQLyNM7yNP519u_L9UfP36AeAaxh1rMTzcM8z9M18FpJgR1tJ5BfcPO6ZRwj7A5wOYZ1GGu3IPcgtzhU67ZgzoKUN_u6E_ZcP_bSy6asDFZf8EDgnqe2hfsK0Fizbb7S6dEkUFuk32ncAa5PczTl-fe9LHP_PpyPKIhM3aUEGpxgFogB2wJNfLbQKid1QnPIWY4d6P2Bq1nikMkXrrmSRlMaH1i7dlqtsHjvMM0Ynq_jNZQWmXL_OWRJ960GykTaL9M5YAaz6OfOzMvaYPh_KGtCz5xHDsOEeRxEsY94d1SHS_jlTx_jk-oI6H1XYiROnZvGOlv6pjM6tHT7x5DNBSzgi74m_UdLYq513x3yqa7Td6gD_ygNyt6Jex09oCwjbqjbJxlq5191x81E9ecm1p8UTEPzMy__P7nEdvA_bSynZT1NqF17ukc4pVMZurDK90o4vcM-n8wn61NuOyKPUVaFaZRZqd2uqCm3ChRbdelVEXfKKU2cr3TwlR1KVqldzuxqep6LeX2vC5NYRspZFWWoiy35baSq7oTJIU8l9QJtZMSKkFXbd3Kuds1X6jCpjRSU5bVelsXTrfk0nQzpfT0ihMKUuaLGpvc9NSOlwSVcDZx-qRhy46aI8gDyMPjoX_Gh0wOzj0qrz35e6C8WUI46Eiee0o2ZbuGSDfynJF7Yj5zmhM_pZBSMUb3_8-G5X5sV124gjxlocvP0xBDzhPI07ReAnla9r818r8AAAD__8XDdiQ">