This pretty naively follows the implementation suggested by Richard.
I'd like to switch these over to be fatal errors (since they are
essentially similar to err_pp_file_not_found), but I'm still investigating
some test failures that happen when I switched them over.
I'm really not a fan of the `M->isAvailable(getLangOpts(), getTargetInfo(),
Requirement, MissingHeader)` function; it seems to do too many things at
once, but for now I've done things in a sort of awkward way.
The changes to test/Modules/Inputs/declare-use/module.map
were necessitated because the thing that was meant to be tested there
(introduced in r197805) was predicated on silently falling back to textual
inclusion, which we no longer do.
The changes to test/Modules/Inputs/macro-reexport/module.modulemap
are just an overlooked missing header that seems to have been missing since
this code was committed (r213922), which is now caught.
When this diag was only used for @import it was okay because you get a separate diagnostic telling you that the module build failed, so it was clear what happened.
@import Foo; error: header 'bar.h' not found
error: could not build module 'Foo'
But now it's odd to get an error about a different header than the one you included with no indication that it's because of a module:
#include <foo.h> // error: header 'bar.h' not found
We could shoehorn the module name into the diagnostic, or perhaps emit a note on the header decl in the module map file.