ΒΆtemplate <typename T>
T& cantFail(Expected<T&> ValOrErr,
            const char* Msg = nullptr)

Description

Report a fatal error if ValOrErr is a failure value, otherwise unwraps and returns the contained reference. This function can be used to wrap calls to fallible functions ONLY when it is known that the Error will always be a success value. E.g.

Declared at: llvm/include/llvm/Support/Error.h:804

Templates

T

Parameters

Expected<T&> ValOrErr
const char* Msg = nullptr