In this patch the dependency scanner starts using proper DiagnosticOptions parsed from the actual TU command-line in order to mimic what the actual compiler would do. The actual functionality will be enabled and tested in follow-up patches. (This split is necessary to avoid temporary regression.)
Depends on D108976.
Should this just be:
?
Also, is there a positive CHECK or two you could add? And possibly a comment to explain what the test is for? (It's not obvious to me from the name "diagnostics".)