[PATCH] [modules] PR20507: Avoid silent textual inclusion.

Ben Langmuir blangmuir at apple.com
Tue Jun 16 14:11:25 PDT 2015


================
Comment at: include/clang/Basic/DiagnosticCommonKinds.td:89-90
@@ -87,1 +88,4 @@
+  "module '%0' %select{is incompatible with|requires}1 feature '%2'">;
+def err_module_header_missing : Error<
+  "%select{|umbrella }0header '%1' not found">;
 def err_module_lock_failure : Error<
----------------
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.

http://reviews.llvm.org/D10423

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list