Constructs a diagnostics object with empty error messages.
diagnostics() = default;
No-throw guarantee.