[PATCH] Add DiagnosticSuppressionScope RAII class

Brad King brad.king at kitware.com
Fri Oct 31 06:26:21 PDT 2014


On 10/30/2014 09:06 PM, Richard Smith wrote:
>> One can see that both B::B() and C::C() get errors as desired.
> 
> That is not guaranteed, and will no longer be the case when we
> fix the bug described above.

Interesting.  Please help me understand this: the docs of setInvalidDecl
say it is for "graceful error recovery".  From the point of view of a
compiler that sounds like once one error has been emitted the failed
declaration is marked as invalid and any further error resulting from
encountering the invalid declaration should not be emitted.  That way
users do not see errors that are only caused by earlier errors.  Is that
the goal?  In that case the current behavior does appear to be a bug.

Thanks,
-Brad




More information about the cfe-commits mailing list