Was writing test cases and found that clang fails to diagnose destroying operator delete with dependent parameters in function scoped class definitions:
Was writing test cases and found that clang fails to diagnose destroying operator delete with dependent parameters in function scoped class definitions:
```cpp
template <typename T> void test_func() {
struct __attribute__((aligned(128))) MyTerribleThing {
MyTerribleThing(){};
void *operator new(size_t, T) throw() {return 0;}
void operator delete(void *, T){}
void operator delete(MyTerribleThing *, std::destroying_delete_t, T){}
};
auto *obj = new MyTerribleThing;
delete obj;
}
int main() {
test_func<std::align_val_t>();
return 0;
}
```
gcc rejects, clang accepts. Both incorrectly (by my reading of the spec) accept this with the destroying delete removed, and emit an aligned delete.
Was writing test cases and found that clang fails to diagnose destroying operator delete with dependent parameters in function scoped class definitions:
gcc rejects, clang accepts. Both incorrectly (by my reading of the spec) accept this with the destroying delete removed, and emit an aligned delete.