[libc++] Better handling for zero-sized types.
Zero-sized types are a GCC extension, also supported by Clang. In theory it's already invalid to `delete` a void pointer or a pointer-to-incomplete, so we shouldn't need any special code to catch those cases; but in practice Clang accepts both constructs with just a warning, and GCC even accepts `sizeof(void)` with just a warning! So we must keep the static_asserts. The hard errors are tested in `unique_ptr_dltr_dflt/*.compile.fail.cpp`. In ranges::begin/end, check `sizeof >= 0` instead of `sizeof != 0`, so as to permit zero-sized types while still disallowing incomplete types. Fixes #54100. Differential Revision: https://reviews.llvm.org/D120633
Loading
Please sign in to comment