Skip to content

Commit fecc733

Browse files
committed
Properly compute iterating expansion stmt size
1 parent 8a64258 commit fecc733

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/test/CodeGenCXX/cxx2c-iterating-expansion-stmt.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,14 @@ struct CustomIterator {
7474
return {n + m};
7575
}
7676

77+
constexpr void operator++() { ++n; }
78+
7779
constexpr int operator*() const {
7880
return n;
7981
}
8082

81-
// FIXME: Should be '!=' once we support that properly.
82-
friend constexpr __PTRDIFF_TYPE__ operator-(iterator a, iterator b) {
83-
return a.n - b.n;
83+
friend constexpr bool operator!=(iterator a, iterator b) {
84+
return a.n != b.n;
8485
}
8586
};
8687

0 commit comments

Comments
 (0)