[PATCH] D36728: Switch to consumeError(), since this can crash otherwise.
Lang Hames via Phabricator via cfe-commits
cfe-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>.
More information about the cfe-commits