you may want to read further up to see if you can understand something about the reasons (not that I know much about it).
You can also instruct the OOM to deprioritise clang++ in the killing. Unfortunately it's not done on per-binary base, but per-process, so you need something like this running in another terminal during the build to hope to catch each new clang++ instance early enough and tell the oom to set its killing priority to -1000.
while sleep 0.001; do choom -n -1000 -p $(pidof clang++) 2>/dev/null; done