[PATCH] D49518: [VFS] Emit an error when a file isn't located in any directory.

Bruno Cardoso Lopes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 19 06:50:54 PDT 2018


bruno added a comment.

Hi Volodymyr, thanks for improving this.

> Need to double check what tests we have when using relative path names at the root level.

Another interesting place to look at is `unittests/Basic/VirtualFileSystemTest.cpp`

> I'd like to make the behavior consistent because a file name is a specific case of relative paths. So far there are no assertions and no errors but file lookup doesn't seem to be working.

Makes sense. My general impression is that relative paths don't make sense here either, but you can address that in a follow up patch (giving time for any potential counterexample on this).



================
Comment at: clang/lib/Basic/VirtualFileSystem.cpp:1416
+        if (NameValueNode)
+          error(NameValueNode, "file is not located in any directory");
+        return nullptr;
----------------
vsapsai wrote:
> Not happy with the error message but didn't come up with anything better. Suggestions are welcome.
What about the message you used in the comment: `file entry is at the root level, outside of any directory` ?


https://reviews.llvm.org/D49518





More information about the cfe-commits mailing list