<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63427>63427</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
void{} is not supported
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Fedr
</td>
</tr>
</table>
<pre>
This program
```
template<typename T>
T bar() { return T{}; }
int main() {
// error in Clang
bar<void>();
}
```
must be accepted since C++20. See https://cplusplus.github.io/CWG/issues/2351.html
Unfortunately, Clang 16 prints the error:
```
error: illegal initializer type 'void'
```
Online demo: https://gcc.godbolt.org/z/zv9nzq36G
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsUs9unDwQf5rhMgoCG3A4cAjkI8fv0K16tmEWXBmb2iZS8vQVsNEmVSSMBeP5_fPIEPRkiRooWyifE7nF2fmmp9Enyo1vzWXWAVfvJi8XyJ4he4Iquz3HZ6RlNTIS8C6-rWTlQngB_t9ZvaCSHtgjsBpBtOgpbt7iBUQL4hl4i_t24h5vbSMuUtt7z_kfERFYD6xH8t551BY7I-10L-9MvHt1etzpj37gt_Y7y1f1yxYiKkI5DLRGGjFoOxB2wFpgLctS_EGEc4xrAP50ChhWs4V9pZOO86ZS7YD13a8XYL0OYaMArGe8zNM5LuazuZ_26nzcrIxk3oB1pwPMK1y9tjFgnOm0t5N9p_ejiNoYmqRBbXXU0uh38rjnj8DEEQET3wL8b422hCMtbof56mwahnRyo3Imps5PwPr3fb3W9v0Pr16SseFjzWuZUJNXj4IXNa9FMjeC54OqVKWGuhJU1lmRC8Ufy7zMRHFVZaIbljGeVSzPWVaXIi2YYEpwVuf19cquCoqMFqlNaszrsnMnR5JNxQsmEiMVmfAxo77ZDz2obQpQZEaHGO5tUUdDzZHAMWKoA1oXMWzr6nykMdm8af6xfV7j4BZg_Y502x5W737TED_f6yHobwAAAP__1PDyVQ">