[PATCH] D19843: Use the name of the file on disk to issue a new diagnostic about non-portable #include and #import paths.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Fri May 27 15:04:20 PDT 2016


rsmith accepted this revision.
rsmith added a reviewer: rsmith.
rsmith added a comment.
This revision is now accepted and ready to land.

LGTM once the LLVM side is landed.


================
Comment at: include/clang/Basic/DiagnosticLexKinds.td:278
@@ +277,3 @@
+def pp_nonportable_path : Warning<
+  "non-portable path '%0' found in preprocessor directive">,
+  InGroup<NonportableIncludePath>;
----------------
The fix-it hints aren't shown in some modes of operation; it might be helpful for this diagnostic to be a bit more explicit about what's non-portable since without the fixit it's not obvious. Maybe something like

    "non-portable path to file '%0'; specified path differs in case from file name on disk"

where %0 is the corrected path?

================
Comment at: lib/Lex/PPDirectives.cpp:1763-1765
@@ +1762,5 @@
+  // than the one we're about to open.
+  //
+  // Because testing for non-portable paths is expensive, only do it if the
+  // warning is not currently ignored.
+  const bool CheckIncludePathPortability =
----------------
Looks like this comment is stale?


http://reviews.llvm.org/D19843





More information about the cfe-commits mailing list