[PATCH] D36728: Switch to consumeError(), since this can crash otherwise.

Lang Hames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 15 14:27:38 PDT 2017


lhames added a comment.

The preferred solution to this is actually to wrap the call with cantFail (See http://llvm.org/docs/ProgrammersManual.html#using-cantfail-to-simplify-safe-callsites) -- it will handle both the assertion and consumption of the value for you, and will simplify calls that return an Expected<T>.


Repository:
  rL LLVM

https://reviews.llvm.org/D36728





More information about the llvm-commits mailing list