Clang 18 is currently broken, it cannot link with its own libc++ but it tries to use gcc stdc++ which is wrong.
Just got any super tiny project like:

git clone https://github.com/bvbfan/lock_free.git
cd lock_free
mkdir build && cd build && cmake .. -DCMAKE_CXX_COMPILER=clang -DCMAKE_C_COMPILER=clang
make -j6

Linking fails since it tries to mismatch std libc++ with gcc.

Not a pacman issue, nor clear were the error is, since all rebuilds needed for new LLVM/clang did not show any of the above errors

Could be cmake issue? Or time-to-time clang needs new parameters once compiling it, due to default configuration changes.

All PKGBUILDs that use clang as compiler need/use these export lines:

export CC=/usr/bin/clang
export CXX=/usr/bin/clang++

make sure to add those to your clang builds

-DCMAKE_CXX_COMPILER=clang -DCMAKE_C_COMPILER=clang

It should be the same. It looks like clang 18 doesn't fallback correctly. DCMAKE_CXX_COMPILER=clang++ fixes the issue, but actually it should work, it's an upstream issue.