[configure] What do I need to configure to support c++20 features when building clang?

  • base on Compiler Explorer, I’m sure the clang already supported c++20 features

  • While base on my local build, it does n’t exist the head file compare

~/test/PR59740 » ~/llvm-project-upstream/buildD/bin/clang++ -g0 -O3 -std=c++20  test-all.cpp                     zhongyunde@A191240619
test-all.cpp:2:10: fatal error: 'compare' file not found
#include <compare>
  • Bypass, the g++ can works fine on my machine, and we can see it uses the system head file /usr/local/include/c++/11.2.0/compare.
~/test/PR59740 » g++ -g0 -O3 -std=c++20  test-all.cpp -S -M                                                      zhongyunde@A191240619
test-all.o: test-all.cpp /usr/include/stdc-predef.h \
 /usr/local/include/c++/11.2.0/compare \
 /usr/local/include/c++/11.2.0/concepts \
 /usr/local/include/c++/11.2.0/type_traits \
 /usr/local/include/c++/11.2.0/aarch64-unknown-linux-gnu/bits/c++config.h \
 /usr/local/include/c++/11.2.0/aarch64-unknown-linux-gnu/bits/os_defines.h \
 /usr/include/features.h /usr/include/sys/cdefs.h \
 /usr/include/bits/wordsize.h /usr/include/bits/long-double.h \
 /usr/include/gnu/stubs.h /usr/include/gnu/stubs-lp64.h \
 /usr/local/include/c++/11.2.0/aarch64-unknown-linux-gnu/bits/cpu_defines.h \
 /usr/local/include/c++/11.2.0/pstl/pstl_config.h \
 /usr/local/include/c++/11.2.0/cstdint \
 /usr/local/lib/gcc/aarch64-unknown-linux-gnu/11.2.0/include/stdint.h \
 /usr/include/stdint.h /usr/include/bits/libc-header-start.h \
 /usr/include/bits/types.h /usr/include/bits/typesizes.h \
 /usr/include/bits/wchar.h /usr/include/bits/stdint-intn.h \
 /usr/include/bits/stdint-uintn.h