<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/94435>94435</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Fully specializing a deleted constructor makes the class constructible, but doesn't actually run the constructor (leaves the object uninitialized)
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
HolyBlackCat
</td>
</tr>
</table>
<pre>
Found this on [stackoverflow](https://stackoverflow.com/q/78579178/2752075).
```cpp
#include <iostream>
template<typename T>
struct Foo
{
Foo() = delete;
void print()
{
std::cout << m_what << std::endl;
}
private:
T m_what;
};
template<>
Foo<int>::Foo() : m_what{999}
{
std::cout << "Constructor INT" << std::endl;
}
int main()
{
Foo<int> bar;
bar.print();
return 0;
}
```
Here constructing `Foo<int> bar;` *doesn't* print `"Constructor INT"` and leaves `m_what` uninitialized.
Tested on Clang 18 and trunk.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VEGTqygQ_jXthXopBZV48JCYZ7297GnuWwg9CTsILmCmZn_9FtFJzOzUS6USpb_-ur-vARGCPlvEFqojVKdMzPHifPvLmY-jEfKtEzEbnPpoezdbReJFB-IsgeoYopBv7or-1bh3qE5A95cYpwDsALQH2j8BdtKNQPt_gPZ8X_Gm4HugPeUVzXkFtNlBfoL8sP7W-fKV07SuUKatNLNCAqzTLkSPYgT2c5sWcZyMiAisix8TWjEiebljQvSzjKR3bs3hx-WBEHJbpXugDQF2IgoNJprjlj3Brk4rMnlt44J-RJ7Y0idElZxgB-nmmJoG1pHxr_eLuL_dIWiVuVdb2E7b0pPX15uuTSsvK9mjS3760vHGj7sLSSjrkgD2cym-lX74JOXHpmkeXdzFfasKKO2cXfx1nvzx5wtQ-nuRXwRqG8kotN26-r_5fLZNBuGf3BqE322Hso15jLO3JP-m8ucmW15_oUciP2VoeyZQ59-VrXMC9KAcBguUR6CHZUck_LdOpAxhFTEorhgSbDW5zslstdVRC6P_RfV0Bl4wRFTprHVG2DMp9jeS6Gf7tgIz1TLVsEZk2Ba84BUv9lWVXVrFuWSNUPkg60EiDpUqykoVqixKWdYq0y3NaZnXeZXzgrNqx9krVa9KsnqP_LUuocxxFNrsjLmOO-fPmQ5hxrYpS1ZlRgxowu3KoNTiO7kFk9TqlPk25fwY5nOAMjc6xPBgiToabPvZmA8SJpQ35clssR469ZiB82QUbxhIvCCRRoSwmc9gEGhHhjmS-yiIkHEWidrPdsnacAHdrxNIETf8jTI--w-0yWZv2udr7KzjZR7W-ysJWf9-TN4lDqD9TX4A2i_2XFv6XwAAAP__3jyPBQ">