In a clang-tidy check I am writing, I want to show multiple ranges. And there is
inline const DiagnosticBuilder &operator<<(const DiagnosticBuilder &DB,
ArrayRef<SourceRange> Ranges)
which seems to be exactly what I need. So I tried
SmallVector<SourceRange, 4> RangesToShow = ...;
auto Diag = diag(RangesToShow[0].getBegin(), AMessage) << RangesToShow;
and verified that in the test case RangesToShow.size()
is 2, but instead of the desired
<range1> <range2>
^^^^^^^^ ^^^^^^^^
I see
<range1> <range2>
^