I get literally the same error with --detect. And honestly when the README says "transferring a piece of software that's working on one computer to another is as simple as this" you can't blame me for taking that at face value.
So why does that work?
{"clang", nullptr}
{"clang++", "--driver-mode=g++"}
{"clang-c++", "--driver-mode=g++"}
{"clang-cc", nullptr}
{"clang-cpp", "--driver-mode=cpp"}
{"clang-g++", "--driver-mode=g++"}
{"clang-gcc", nullptr}
{"clang-cl", "--driver-mode=cl"}
{"cc", nullptr}
{"cpp", "--driver-mode=cpp"}
{"cl", "--driver-mode=cl"}
{"++", "--driver-mode=g++"}
{"flang", "--driver-mode=flang"}
`clang++-x` matches none of these. Then the same logic is applied to the name with any of "0123456789." trimmed from the right. Still no match. Then the trailing `-component` is stripped, and `clang++` matches.It works by chance...
See https://github.com/llvm/llvm-project/blob/c22b110612600b0d0a... and https://github.com/llvm/llvm-project/blob/c22b110612600b0d0a...
TIL: if you symlink ++ -> clang it works as a compiler in C++ mode.
Note that this is only about the compiler driver mode, i.e. the default libraries, search paths, include directories, etc. The source language is determined by the file extension unless specified with e.g. `-x c++`.