During a make buildworld of 14.2S on platform:
# uname -vKU; clang -v
FreeBSD 13.2-STABLE-HBSD myworkingbranch-n192055-d8d941603dd
HARDENEDBSD-13-STABLE 1302509 1302509
FreeBSD clang version 16.0.6 (
https://github.com/llvm/llvm-project.git
llvmorg-16.0.6-0-g7cbf1a259152)
Target: x86_64-unknown-freebsd13.2
Failure message:
error: invalid value 'c++23' in '-std=c++23'
note: use 'c++98' or 'c++03' for 'ISO C++ 1998 with amendments' standard
note: use 'gnu++98' or 'gnu++03' for 'ISO C++ 1998 with amendments and
GNU extensions' standard
...
note: use 'c++20' for 'ISO C++ 2020 DIS' standard
note: use 'gnu++20' for 'ISO C++ 2020 DIS with GNU extensions' standard
note: use 'c++2b' for 'Working draft for ISO C++ 2023 DIS' standard
note: use 'gnu++2b' for 'Working draft for ISO C++ 2023 DIS with GNU
extensions' standard
*** [algorithm.o] Error code 1
make[4]: stopped in /big/hardenedbsd-14-stable/lib/libc++
1 error
# find /usr/src/ -type f | xargs grep 'c++23'
/usr/src/lib/libc++/Makefile:CXXSTD?= c++23
Check reference:
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD/-/blob/hardened/current/master/lib/libc++/Makefile?ref_type=heads
So a temporary workaround is to replace c++23 with c++20 in
lib/libc++/Makefile
.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 130000
# NOTE: gcc 12 cannot correctly compile all libc++'s C++23 code. To
temporarily
# support gcc 12, compile libc++ in C++20 mode, but this will leave out any
# C++23 features.
CXXSTD?= c++20
.else
# 202502 DPG kludge because of clang 16.0.6 on HBSD13.2S failure with
# CXXSTD?= c++23
CXXSTD?= c++20
.endif
Hope that this is helpful.