<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58112>58112</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Clang accepts invalid out of class definition for destructor
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ranaanoop
      </td>
    </tr>
</table>

<pre>
    The following invalid program is accepted by clang. [Demo](https://godbolt.org/z/TYjEzss6q)

```
template<typename T>
struct C
{
    ~C();
};
template<typename T>
C<T>::~C<T>()             //this is accepted by clang!!
{

}
int main()
{
    C<int> c;;
}
```

This has been discussed [here](https://stackoverflow.com/questions/73928601/clang-accepts-out-of-class-destructor-definition-while-gcc-does-not)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx9U81yozAMfhpz8ZAxJuHnwKH5e4Jc9miMAHeNTW2TTPr0KwhturudeoSRJSx9nyRq29yrSw-0tVrbmzIdVeYqtGro6GznxECVp0JKGAM0tL5TqYXpNpTs9kcYLNkdCS_6EEZP0hfCzyidbWqrw8a6Dk_v-Fx-vZ7evc_eCC8JOxL2su4ZW2U5BhhGLQKQ9BDuIxgxAL2Q9PTw-uAmGehhvZrvHwrFRfLTAWHM0dP9h__4qf8c94Dm5YT4UeZQq2GJSL-uB8HQY02-KwvhySx_A3ziWRRlAh2EMive_8nM6fEjBEDlTOEro--q9tgvM6ZeeFoDGNooLyfvERr2qQcH3_XJByF_2yu4Fju_kXZA29sEPihrPOp5WvIiY0jpvLCLH3x9bKcQ2zZGo_dxA4_GWIdqq4yar8e3XmmIOynjxoKPjQ1INoIqybJtnuZFmURNlTZlWoooqKChOswp1pL6zyHEVNS2dElFn_FxXB19Zo4mp6t_hlCFfqpXVlpfP14xjvUrSIRzVt4jW1R2RZLwqK-4KPM2L3ieA89YW-ZCgkxbxuumLQoJkRY1aF9hTQnnBm50CYE6ljdSFWecJ4zxpEySNNlAKxmTBWct7LZl1pItA-y83sw45r8jctUCqZ46j06tfPBPJzJWnQFY0mF8MYXeusoJI4SxdoyW5NUC_g8YVyKG">