forked from OSchip/llvm-project
Coverage: Fix iterated type for LineCoverageIterator
LineCoverageIterator is not providing access to a mutable object. Fix it
to iterate over `const LineCoverageStats` so that `operator->()`
compiles again after 6b9b86db9d
.
This commit is contained in:
parent
ae389b2450
commit
77898a4c0c
|
@ -693,8 +693,9 @@ public:
|
|||
/// An iterator over the \c LineCoverageStats objects for lines described by
|
||||
/// a \c CoverageData instance.
|
||||
class LineCoverageIterator
|
||||
: public iterator_facade_base<
|
||||
LineCoverageIterator, std::forward_iterator_tag, LineCoverageStats> {
|
||||
: public iterator_facade_base<LineCoverageIterator,
|
||||
std::forward_iterator_tag,
|
||||
const LineCoverageStats> {
|
||||
public:
|
||||
LineCoverageIterator(const CoverageData &CD)
|
||||
: LineCoverageIterator(CD, CD.begin()->Line) {}
|
||||
|
@ -711,8 +712,6 @@ public:
|
|||
|
||||
const LineCoverageStats &operator*() const { return Stats; }
|
||||
|
||||
LineCoverageStats &operator*() { return Stats; }
|
||||
|
||||
LineCoverageIterator &operator++();
|
||||
|
||||
LineCoverageIterator getEnd() const {
|
||||
|
|
|
@ -693,6 +693,9 @@ TEST_P(CoverageMappingTest, test_line_coverage_iterator) {
|
|||
++Line;
|
||||
}
|
||||
ASSERT_EQ(11U, Line);
|
||||
|
||||
// Check that operator->() works / compiles.
|
||||
ASSERT_EQ(1U, LineCoverageIterator(Data)->getLine());
|
||||
}
|
||||
|
||||
TEST_P(CoverageMappingTest, uncovered_function) {
|
||||
|
|
Loading…
Reference in New Issue