Skip to content

Commit 30f1912

Browse files
committed
[interop][SwiftToCxx] use unconditional noexcept for C++ collection overlay
accessing collection in noexcept is wrong
1 parent 07ccee2 commit 30f1912

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/PrintAsClang/_SwiftStdlibCxxOverlay.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,10 @@ template <class Collection, class T> class CollectionIterator {
9393
// FIXME: End read access.
9494
}
9595

96-
SWIFT_INLINE_THUNK T operator*() const noexcept(noexcept(collection[index])) {
96+
SWIFT_INLINE_THUNK T operator*() const noexcept {
9797
return collection[index];
9898
}
99-
SWIFT_INLINE_THUNK void operator++() noexcept(noexcept(++index)) {
99+
SWIFT_INLINE_THUNK void operator++() noexcept {
100100
++index;
101101
// FIXME: assert(index <= endIndex); // No need to go past the end.
102102
}

0 commit comments

Comments
 (0)