[cfe-dev] Diagnostics are unconditionally suppressed after fatal error

Enea Zaffanella zaffanella at cs.unipr.it
Thu Apr 15 10:46:35 PDT 2010


Chris Lattner wrote:
> On Apr 15, 2010, at 4:55 AM, Abramo Bagnara wrote:
> 
>> Currently it's not possible for a clang library client to obtain the
>> diagnostics generated after the first fatal error.
>>
>> The attached (trivial) patch add a flag to control this behaviour.
> 
> I'm not sure I understand. The idea of a fatal error is that it is
> the last one emitted. If your library client doesn't want diagnostics
 > to be discarded, it should map things that default to fatal to Error 
instead.
> 
> -Chris

We thought that it was not possible to map a fatal diagnostic to error.
Actually, we tried and we got the following assertion failure:

[Thread 1]
/llvm/tools/clang/include/clang/Basic/Diagnostic.h:333: void 
clang::Diagnostic::setDiagnosticMapping(clang::diag::kind, 
clang::diag::Mapping): Assertion failed: 
(isBuiltinWarningOrExtension(Diag) || Map == diag::MAP_FATAL) && "Cannot 
map errors!"
Aborted

Are there other ways to map a fatal to error?

Cheers,
Enea Zaffanella.



More information about the cfe-dev mailing list