Description
In the interface InterOp::Declare
we have an option silent
which means that even if the code does not compile we should not print an error on the screen.
Currently:
CppInterOp/lib/Interpreter/InterOp.cpp
Lines 2586 to 2587 in 8963daa
We handle this by turning on suppressing all diagnostics here:
CppInterOp/lib/Interpreter/InterOp.cpp
Lines 2567 to 2579 in 8963daa
However, this prevents us to realize there was an error because the interpreter checks if diagnostics occurred to set the error and InterOp::Declare
to return kFailure
. If silent
is passed we should swap the default diagnostic consumer with IgnoringDiagConsumer. However, the problem is that we should have some place to store the default and the ignoring consumer. The storing of such state is problematic for CppInterOp as we do not want many function static
members but do not have a good way to store this. Perhaps the easiest would be to implement our custom clang::DiagnosticConsumer
which has a flag to ignore the coming diagnostics.