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 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits