: DiagObj(diagObj), NumArgs(0), NumRanges(0), NumFixItHints(0) {}
friend class PartialDiagnostic;
+
+protected:
+ void FlushCounts();
public:
/// Copy constructor. When copied, this "takes" the diagnostic info from the
return true;
}
+void DiagnosticBuilder::FlushCounts() {
+ DiagObj->NumDiagArgs = NumArgs;
+ DiagObj->NumDiagRanges = NumRanges;
+ DiagObj->NumFixItHints = NumFixItHints;
+}
+
bool DiagnosticBuilder::Emit() {
// If DiagObj is null, then its soul was stolen by the copy ctor
// or the user called Emit().
// When emitting diagnostics, we set the final argument count into
// the Diagnostic object.
- DiagObj->NumDiagArgs = NumArgs;
- DiagObj->NumDiagRanges = NumRanges;
- DiagObj->NumFixItHints = NumFixItHints;
+ FlushCounts();
// Process the diagnostic, sending the accumulated information to the
// DiagnosticClient.
case Diagnostic::SFINAE_Suppress:
// Make a copy of this suppressed diagnostic and store it with the
// template-deduction information;
+ FlushCounts();
DiagnosticInfo DiagInfo(&SemaRef.Diags);
+
Info->addSuppressedDiagnostic(DiagInfo.getLocation(),
PartialDiagnostic(DiagInfo,
SemaRef.Context.getDiagAllocator()));