class MSVCPError
Declaration
class MSVCPError : public Error { /* full declaration omitted */ };
Description
Lightweight error class with error context and mandatory checking. Instances of this class wrap a ErrorInfoBase pointer. Failure states are represented by setting the pointer to a ErrorInfoBase subclass instance containing information describing the failure. Success is represented by a null pointer value. Instances of Error also contains a 'Checked' flag, which must be set before the destructor is called, otherwise the destructor will trigger a runtime error. This enforces at runtime the requirement that all Error instances be checked or returned to the caller. There are two ways to set the checked flag, depending on what state the Error instance is in. For Error instances indicating success, it is sufficient to invoke the boolean conversion operator. E.g.: A success value *can not* be dropped. For example, just calling 'foo( < ...>)' without testing the return value will raise a runtime error, even if foo returns success. For Error instances representing failure, you must use either the handleErrors or handleAllErrors function with a typed handler. E.g.: The handleAllErrors function is identical to handleErrors, except that it has a void return type, and requires all errors to be handled and no new errors be returned. It prevents errors (assuming they can all be handled) from having to be bubbled all the way to the top-level. *All* Error instances must be checked before destruction, even if they're moved-assigned or constructed from Success values that have already been checked. This enforces checking through all levels of the call stack.
Declared at: llvm/include/llvm/Support/MSVCErrorWorkarounds.h:27
Inherits from: Error
Method Overview
- public MSVCPError()
- public MSVCPError(llvm::MSVCPError && Other)
- public MSVCPError(llvm::Error Err)
Inherited from Error:
Methods
¶MSVCPError()
MSVCPError()
Declared at: llvm/include/llvm/Support/MSVCErrorWorkarounds.h:29
¶MSVCPError(llvm::MSVCPError&& Other)
MSVCPError(llvm::MSVCPError&& Other)
Declared at: llvm/include/llvm/Support/MSVCErrorWorkarounds.h:31
Parameters
- llvm::MSVCPError&& Other
¶MSVCPError(llvm::Error Err)
MSVCPError(llvm::Error Err)
Declared at: llvm/include/llvm/Support/MSVCErrorWorkarounds.h:38
Parameters
- llvm::Error Err