<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 8, 2015 at 7:16 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">rsmith added inline comments.<br>
<br>
================<br>
Comment at: lib/Lex/PPDirectives.cpp:1665<br>
@@ +1664,3 @@<br>
+  // unavailable, diagnose the situation and bail out.<br>
+  if (SuggestedModule && !SuggestedModule.getModule()->isAvailable()) {<br>
+    clang::Module::Requirement Requirement;<br>
----------------<br>
rsmith wrote:<br>
> rsmith wrote:<br>
> > I think this whole block should be moved down to line 1761 or so:<br>
> ><br>
> >  1. The code currently ensures that it always calls InclusionDirective on the callback object for every `#include`, even if that include fails.<br>
> >  2. We don't yet know that the file is actually part of `SuggestedModule`; it could be in the directory of an umbrella header whose module is unavailable, but it might not be part of that module.<br>
> >  3. If we somehow got a suggested module but no file, we should not produce additional spurious diagnostics beyond the "file not found" diagnostic we already produced.<br>
> One other thing: we should only diagnose when `ShouldEnter` is `false`. If we're entering the file anyway, we don't need the module to be available; only those files within it that we're actually entering need to be present.<br>
</div></div>Hmm, that's not quite right (`ShouldEnter` will be `false` the second time we reach a header with an include guard too). I think the right thing is: don't diagnose this if the suggested module's top-level module is either the current module or the "implementation of" module (that is, if it's a module we'll /always/ enter textually).<br></blockquote><div><br></div><div>What are the semantics of the "current" module and the "implementation of" module? I.e. what do they mean in general?</div><div><br></div><div>-- Sean Silva</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__reviews.llvm.org_D10423&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=BSqEv9KvKMW_Ob8SyngJ70KdZISM_ASROnREeq0cCxk&m=2traU1VYfHxubxymY4_RVJIetVI8LwxfMyOOE3UNsdg&s=FItmphQxu-wfT6fP_KEvfpYSV9B8sv-SyqTtyFMR_3I&e=" rel="noreferrer" target="_blank">http://reviews.llvm.org/D10423</a><br>
<br>
<br>
<br>
</blockquote></div><br></div></div>