Compilation failure with on branch master in destroying_delete_t.pass.cpp

Hi all,

I’ve been seeing this failure for a couple weeks. I assume I am doing something wrong, but I can’t tell what. :slight_smile:

$ git pull --rebase
$ git checkout master
$ git diff origin/master
→ confirming no difference
$ cd build
$ ninja check-all
GNU C++17 (Debian 8.3.0-6) version 8.3.0 (x86_64-linux-gnu)
compiled by GNU C version 8.3.0, GMP version 6.1.2, MPFR version 4.0.2-rc1, MPC version 1.1.0, isl version isl-0.20-GMP

warning: MPFR header version 4.0.2-rc1 differs from library version 4.0.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 5e2cda5349948e2d3e86e3d9186f42cf
/usr/local/google/home/palmer/llvm-project/libcxx/test/std/ error: ‘operator delete’ takes type ‘void*’ as first parameter
void operator delete(A*, std::destroying_delete_t);
/usr/local/google/home/palmer/llvm-project/libcxx/test/std/ error: ‘operator delete’ takes type ‘void*’ as first parameter
void A::operator delete(A* a, std::destroying_delete_t) {
/usr/local/google/home/palmer/llvm-project/libcxx/test/std/ In function ‘int main()’:
/usr/local/google/home/palmer/llvm-project/libcxx/test/std/ error: no suitable ‘operator delete’ for ‘A’
delete ap;

I assume the problem is that I am using GNU C++17 to compile (as stated in the message), and the feature requires C++20 (as stated at the top of destroying_delete_t.pass.cpp

I tried setting my CXX environment variable to clang++, but that didn’t change the outcome. Following the docs, I also tried that, plus:

$ cmake -G Ninja -DLLVM_CXX_STD=c++20 ../llvm

CMake Warning:
Manually-specified variables were not used by the project:


So I’m sure I’m doing something wrong, but I don’t know what else to try. Any clues? Thanks. :slight_smile:

The patch “Update the docs for building libc++” gave me the info I needed to get over this hurdle. Thanks. :slight_smile: