tra added a comment. In D84362#2275029 <https://reviews.llvm.org/D84362#2275029>, @yaxunl wrote:
> Perhaps we could inherit `PartialDiagnostic` from `DiagnosticBuilder` base class. This would probably be the least invasive approach as it would preserve existing uses while allowing reuse of common `DiagnosticBuilder` functionality. That said, it would muddle the meaning of PartialDiagnostic even more -- is it the diagnostic itself, or a thing that produces the diagnostic? To think of it, we actually don't need the `DiagnosticBuilderBase` per se, but rather a limited subset of operations for implementing freestanding `operator<<`. So the base class for `DiagnosticBuilder` and `PartialDiagnostic` could be called `StreamableDiagnosticBase` and only provide those bits. This way the arrangement looks a bit less awkward. Both DiagnosticBuilder and PartialDiagnostic would inherit from it and would work with `operator<<(StreamableDiagnosticBase)`. We may need to convert StreamableDiagnosticBase results back to the original type. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84362/new/ https://reviews.llvm.org/D84362 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits