[PATCH] D65829: [clang][DirectoryWatcher][NFC] Swapping asserts for llvm fatal_error in ::create.

Saleem Abdulrasool via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 6 14:45:00 PDT 2019


compnerd added a comment.

@gribozavr I think that this usage here is actually useful because it
a) tests the actual behaviour
b) provides example code for other users

The check here ensures that the rest of the code is properly executed, *but* because the error is not actually consumed (you need to explicitly invoke `.takeError()`), `llvm::Expected` will actually tell you that a fatal error has occurred at this point and what the error was.  It provides a much clearer error message than the explicit `llvm_unreachable` IMO.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65829/new/

https://reviews.llvm.org/D65829





More information about the cfe-commits mailing list