https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107126
Bug ID: 107126
Summary: GCC accepts invalid out of class definition for
destructor with C++17
Product: gcc
Version: 12.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jlame646 at gmail dot com
Target Milestone: ---
The following invalid program is accepted by gcc with C++17. Demo:
https://godbolt.org/z/TYjEzss6q
```
template<typename T>
struct C
{
~C();
};
template<typename T>
C<T>::~C<T>() //this is accepted by gcc with c++17
{
}
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