Why does `g++ --version` say LLVM/clang?
In modern versions of macOS, g++ is just a little shim that points to the relevant part of clang in whichever version of Xcode you have installed.

Historically g++ was the C++ compiler that was part of the GCC compiler distribution, but Apple stopped distributing that with the operating system when they moved over to LLVM.

If you want to use the GCC distribution you can install it through homebrew.