65 " by the --conflict policy" <<
emit();
68 "An operative #error directive was outpout" <<
emit();
95 _last_conflicted_symbol_ = symname;
99 case cause::DIFFERENTLY_REDEFING_D:
100 gripe += line +
"\" differently redefines -D symbol";
102 case cause::DEFINING_U:
103 gripe += line +
"\" contradicts -U or --implicit";
105 case cause::UNDEFING_D:
106 gripe += line +
"\" contradicts -D symbol";
111 stringstream ss(
"error : inserted by coan: ");
112 ss.seekp(0,ios_base::end);
118 _policy_code_ = diagnostic.
encode();
119 diagnostic << gripe <<
defer();
124 _policy_code_ = diagnostic.
encode();
125 diagnostic << gripe <<
defer();
126 _subst_text_ = string(
"// ") + ss.str();
131 _policy_code_ = diagnostic.
encode();
132 diagnostic << gripe <<
defer();
133 _subst_text_ = string(
"#") + ss.str();
static parsed_line & cur_line()
Get a reference to the current output line.
template struct warning_msg<Id> generically encapsulates a warning diagnostic.
static void forget()
Forget about an apparent contradiction.
static void save(cause why, std::string const &symname)
Save diagnostic details of a potential contradiction.
cause
Reasons for reporting a contadiction.
static bool is_unconditional_line()
Is the current line outside any #if scope or in the scope of a satisfied #if?
Comment out a contradicted directive.
`template struct diagnostic<Level,Id> generically encapsulates a type of diagnostic.
static void substitute(std::string const &replacement)
Substitute a diagnostic insert for the line in the line-buffer and print it to output.
static std::string in_file_name()
Get the name of the current source file.
struct warning_unconditional_error_output encapsulates a diagnostic for an error directive output unc...
unsigned num() const
Get the greatest source line number spanned by this line.
static void insert_pending()
Insert a stored error diagnostic into output.
static contradiction_policy _policy_
The operative contradiction policy.
static size_t flush(unsigned reason)
Emit all queued diagnostics that match a reason-code.
Delete a contradicted directive.
The tag class is inserted in a diagnostic_base to tell it to emit itself.
contradiction_policy
Symbolic constants denoting policies for handling contradictions.
static void insert(cause why, std::string const &symname)
Insert an error diagnostic into the output as a error directive or comment.
The tag class is inserted in a diagnostic_base to tell it to defer itself.
static void flush()
Discharge any pending contradiction.
template class canonical<What> encapsulates the canonical representation of values of type What...
static std::string _last_conflicted_symbol_
The name of the latest #undef-ed symbol.
static size_t discard(unsigned reason)
Discard any queued diagnostics that match a reason-code, returning the number discarded.
Replace a contradicted directive with an #error
`template struct warning_error_generated_input' encapsulates a diagnostic for error directive output ...
static unsigned _policy_code_
The reason-code of diagnostics associated with the operative contradiction policy.
unsigned encode() const
Get the reason-code of the diagnostic.
static std::string _subst_text_
Text for substitution in output.
std::string & str()
Get a [const] reference to the underlying std::string.