66 unsigned reason =
code(level,
id);
75 _text <<
"while parsing options: ";
83 _text << severity_name <<
' ' <<
"0x" << setfill(
'0')
84 << hex << setw(5) << reason <<
": " << dec;
90 if (!
text().empty()) {
91 cerr <<
text() <<
'\n';
97 throw(
unsigned(*
this));
104 char const * diagnostic_status =
"";
110 diagnostic_status =
" ABNORMALLY";
112 diagnostic_status =
" with errors";
114 diagnostic_status =
" with warnings";
116 diagnostic_status =
" with remarks";
120 << diagnostic_status <<
", exit code 0x" << setfill(
'0') << setw(2) <<
121 hex << ret << dec <<
emit();
125 " input files were reached; "
132 " were abandoned due to parse errors" << emit();
136 "Input lines were dropped" << emit();
140 "Input lines were changed" << emit();
144 "Input lines were changed to #error directives"
149 "Unconditional #error directives are operative"
158 unsigned severities = 0;
159 unsigned summaries = 0;
188 return severities < 4 ? severities | summaries : severities;
194 _queue_.begin()->get()->despatch();
static parsed_line & cur_line()
Get a reference to the current output line.
A fatal error disgnostic.
static unsigned _abends_
Global count of fatal error diagnostics.
static unsigned code(severity level, unsigned id)
Get the reason-code that encodes a causal identifier and severity.
diagnostic_base(std::string const &severity_name, severity level, unsigned id, bool in_code_only=false)
Constructor.
progress_summary_msg< 1 > progress_summary_all_done
Report processing complete.
info_summary_msg< 4 > info_summary_summary_changed_lines
Report that input lines were changed.
info_summary_msg< 2 > info_summary_files_dropped
Report total files abandoned due to errors.
static void flush_all()
Emit any queued diagnostics.
static unsigned error_files()
Get the number of files abandoned due to errors in traversal of the dataset.
static unsigned & lines_changed()
Get a reference to the count of changed lines.
static void top()
Reinitialize the module.
static int exitcode()
Convert the internal exit status to an exit code for exit().
static std::list< ptr > _queue_
Queue of deferred diagnostics.
static std::string in_file_name()
Get the name of the current source file.
unsigned num() const
Get the greatest source line number spanned by this line.
static bool got_opts()
Have we got all the options?
warning_summary_msg< 1 > warning_summary_summary_errored_lines
Report that input lines were converted to #errors
static unsigned _errors_
Global count of error diagnostics.
severity
Enumerated constants representing the severities of diagnostics.
static unsigned & lines_suppressed()
Get a reference to the count of suppressed lines.
virtual void count() const
Increment global counts appropriately for the runtime type.
bool _gagged
Is the diagnostic suppressed?
static void epilogue()
Write summary diagnostics on cerr at exit.
warning_summary_msg< 2 > warning_summary_summary_error_output
Report that unconditional #error lines were output.
info_summary_msg< 3 > info_summary_summary_dropped_lines
Report that input lines were dropped.
The tag class is inserted in a diagnostic_base to tell it to emit itself.
static unsigned files()
Get the number of files in the dataset.
static unsigned _error_directives_generated_
Global count of error directives output.
static unsigned done_files()
Get the number of files reached by traversal of the dataset
static void top()
Reset the depth of #if-nesting to 0.
info_summary_msg< 1 > info_summary_files_reached
Report total files reached.
static unsigned _error_directives_operative_
Global count of operative error directives output.
std::string text() const
Get the text of the diagnostic.
static bool diagnostic_gagged(unsigned reason)
Say whether a diagnostic reason code is gagged.
virtual severity level() const
Get the severity level of the runtime type.
static unsigned _warnings_
Global count of warning diagnostics.
static std::string const & prog_name()
Get the program's name.
std::stringstream _text
The text of the diagnostic.
static unsigned _infos_
Global count of informational diagnostics.
void despatch() const
Emit the diagnostic.