https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126795
Bug ID: 126795
Summary: deleting a void* should be an error in SFINAE context
Product: gcc
Version: 16.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: rs2740 at gmail dot com
Target Milestone: ---
template<class T>
concept deletable = requires(T* p) { delete p; };
static_assert(!deletable<void>); // fires
Since at least C++11 deleting a void* is ill-formed:
The operand shall have a pointer to object type, or a class type having a
single non-explicit conversion function ([class.conv.fct]) to a pointer to
object type.
https://timsong-cpp.github.io/cppwp/std11/expr.delete#1
PR 115747 correctly treated deleting an incomplete type as an error in SFINAE
for C++26+.