Skip to content

Commit 68bd778

Browse files
committed
[cxx-interop] Remove test that triggered UB
Assigning a value to an empty `std::optional` is undefined behavior in C++.
1 parent 63c24af commit 68bd778

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

test/Interop/Cxx/stdlib/use-std-optional.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,8 @@ StdOptionalTestSuite.test("pointee") {
1616
let pointee = nonNilOpt.pointee
1717
expectEqual(123, pointee)
1818

19-
#if !os(Linux) // crashes on Ubuntu 18.04 (rdar://113414160)
2019
var modifiedOpt = getNilOptional()
21-
modifiedOpt.pointee = 777
22-
expectEqual(777, modifiedOpt.pointee)
23-
#endif
20+
expectNil(modifiedOpt.pointee)
2421
}
2522

2623
StdOptionalTestSuite.test("std::optional => Swift.Optional") {

0 commit comments

Comments
 (0)