Simple reproducer:
$ cmake
$ ninja contrib/llvm-project/llvm/lib/MC/MCParser/CMakeFiles/LLVMMCParser.dir/MasmParser.cpp.o # will have -std=c++14
$ touch CMakeLists.txt
$ cmake
$ ninja contrib/llvm-project/llvm/lib/MC/MCParser/CMakeFiles/LLVMMCParser.dir/MasmParser.cpp.o # will have -std=c++20 and fail
(fails because std::vector cannot work with opaque types anymore)
Fixes: #42249 (cc @rschu1ze)