On Mon, Oct 27, 2014 at 8:14 AM, Brad King <[email protected]> wrote:

> Hi Folks,
>
> I'm building a tool based on Clang that needs to test whether certain
> constructs can be compiled without error (e.g. implicit class members).
> In order to do this without issuing diagnostics or stopping the Clang
> operation, I need to be able to suppress emission of diagnostics but
> still know whether any would have been issued.
>
> Here is a patch adding a RAII class to achieve this.  See its commit
> message for details.  Basically the class saves the diagnostic state
> members on construction and restores them on destruction.  While in
> scope a new member tells the diagnostic engine not to emit anything
> but to still maintain counts so that error traps can work.
>
> The patch includes a new test case to cover the new functionality.
> I've tested this patch on several SVN revisions of Clang for the last
> few months, and most recently on r220679.


How does this compare to Sema's existing SFINAETrap mechanism? What happens
if you trigger an error in a non-immediate context with one of these
objects active?
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to