slang::Diagnostic class

Wraps up a reported diagnostic along with location in source and any arguments.

Constructors, destructors, conversion operators

Diagnostic(DiagCode code, SourceLocation location) noexcept
Constructs a new Diagnostic entry with the given code and location.
Diagnostic(const Symbol& source, DiagCode code, SourceLocation location) noexcept
Constructs a new Diagnostic entry with the given symbol, code and location.

Public functions

auto isError() const -> bool
auto addNote(DiagCode code, SourceLocation location) -> Diagnostic&
Adds a new note to the diagnostic at the given source location.
auto operator<<(const std::string& arg) -> Diagnostic&
Adds an argument to the diagnostic.

Public variables

DiagCode code
The specific kind of diagnostic that was issued.
SourceLocation location
The location in source of the cause of the diagnostic.
const Symbol* symbol
The symbol in which the diagnostic occurred, or null if not applicable.

Function documentation

bool slang::Diagnostic::isError() const

Returns true if this diagnostic's code is intrinsically considered an error, regardless of what severity mapping rules might be in place.