Commit b3d95e7
committed
[APINotes] Avoid "two entries for the same version" failure with expensive checks
Found assertion failures when using EXPENSIVE_CHECKS and running
lit tests for APINotes. It seems like std::is_sorted is verifying
that the comparison function is reflective (comp(a,a)=false) when
using expensive checks. So we would get callbacks to the lambda
used for comparison, even for vectors with a single element
in APINotesReader::VersionedInfo<T>::VersionedInfo, with "left"
and "right" being the same object. Therefore the assert checking
that we never found equal values would fail.
Fix makes sure that we skip the check for equal values when
"left" and "right" is the same object.1 parent 5ca3794 commit b3d95e7
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2045 | 2045 | | |
2046 | 2046 | | |
2047 | 2047 | | |
2048 | | - | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
2049 | 2054 | | |
2050 | 2055 | | |
2051 | 2056 | | |
| |||
0 commit comments