So, after quite a rabbit hole I’m just convinced that the problem matcher for tasks in VS Code are simply broken. Pretty much no matter what build system you use or how you run it. Even replicating the VS Code documentation doesn’t work.
The reason it’s working for CMake is because I was testing with the CMake-tools extension which doesn’t use the Terminal window and parses the output from builds in it’s own way.
You can at least fix ctrl+click in the Terminal window by adding this to your clang options in premake5.lua: