[PATCH] D52280: Don't trim non-alphanumeric characters in 'file not found' errors for include directives.

Eric Christopher via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 20 10:23:32 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rC342667: r342177 introduced a hint in cases where an #included file is not found. It… (authored by echristo, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D52280?vs=166184&id=166327#toc

Repository:
  rC Clang

https://reviews.llvm.org/D52280

Files:
  lib/Lex/PPDirectives.cpp


Index: lib/Lex/PPDirectives.cpp
===================================================================
--- lib/Lex/PPDirectives.cpp
+++ lib/Lex/PPDirectives.cpp
@@ -1887,8 +1887,8 @@
 
       // Check for likely typos due to leading or trailing non-isAlphanumeric
       // characters
+      StringRef OriginalFilename = Filename;
       if (!File) {
-        StringRef OriginalFilename = Filename;
         while (!isAlphanumeric(Filename.front())) {
           Filename = Filename.drop_front();
         }
@@ -1915,7 +1915,7 @@
 
       // If the file is still not found, just go with the vanilla diagnostic
       if (!File)
-        Diag(FilenameTok, diag::err_pp_file_not_found) << Filename
+        Diag(FilenameTok, diag::err_pp_file_not_found) << OriginalFilename
                                                        << FilenameRange;
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52280.166327.patch
Type: text/x-patch
Size: 855 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180920/289a3d8c/attachment-0001.bin>


More information about the cfe-commits mailing list