33 mutable std::string msg;
46 std::unique_ptr<annotations::SourceLocation>
location;
69 const char *
what() const noexcept override;
76 #define CQASM_ANALYSIS_ERROR(Name) \ 77 class Name : public ::cqasm::error::AnalysisError { \ 80 std::string &&message = "", \ 81 const tree::Annotatable *node = nullptr \ 83 ::cqasm::error::AnalysisError(std::move(message), node) \ const std::string & get_message() const
Constructs the message string.
std::ostringstream message
The stringstream used to construct the message.
AnalysisError(std::string &&message="", const tree::Annotatable *node=nullptr)
Constructs a new error.
Contains annotation objects used within the trees by libqasm.
Toplevel namespace with entry points for the new API.
std::unique_ptr< annotations::SourceLocation > location
Attached location in the source file, if any.
Wrapper for pulling parts of tree-gen's support library into libqasm.
const char * what() const noexcept override
Returns the message exception-style.
void context(const tree::Annotatable &node)
Sets the context of this error to the SourceLocation annotation of the given node, if the error doesn't already have such a context.
::tree::annotatable::Annotatable Annotatable
Exception used for analysis errors.