Commit Graph

12 Commits

Author SHA1 Message Date
Egor Zhdan
1a4176041e [cxx-interop] Do not crash for void begin()
When importing C++ methods, Swift always assumes that methods named `begin()` and `end()` are unsafe, since these methods commonly return iterator types that are inherently unsafe in Swift.

Some additional logic in Sema tries to diagnose usages of `.begin()` and `.end()` from Swift and suggest safe alternatives. That logic had a null pointer dereference bug.

rdar://153814676 / resolves https://github.com/swiftlang/swift/issues/82361
(cherry picked from commit 883ff18adb)
2025-07-01 17:38:30 +01:00
Alexander Cyon
db0b5db54e [test/Interop] Fix typos (#75032) 2024-08-28 09:41:09 -07:00
Doug Gregor
8cd2f34654 Generalize tests for both diagnostic styles, or force the LLVM style
These tests are using FileCheck to check the result of diagnostic
formatting in ways that don't match the new formatter. Force the old
formatter or, where possible, generalize so that they match both
formatters.
2024-02-19 02:48:37 -10:00
zoecarver
ffc57bf903 [cxx-interop][nfc] Fix last straggling test. 2023-07-18 17:42:56 -07:00
Alex Lorenz
b60d635db7 [interop] make interop diagnostics more consistent with the rest of Swift diagnostics 2023-04-10 16:20:07 -07:00
Alex Lorenz
64a4b3159c [interop] add SWIFT_ prefix to the C++ interop annotations 2023-04-06 12:11:25 -07:00
Alex Lorenz
30d0c17bf9 [interop] update names and add docs for the interop C++ helper macros 2023-04-04 15:13:59 -07:00
zoecarver
1513df619b [cxx-interop][nfc] Fix test fallout. 2023-03-20 17:34:19 -07:00
zoecarver
0795083237 [cxx-interop] Object model: fix crash when importing explicitly owned type. 2023-03-17 13:57:24 -07:00
zoecarver
ffec6a297b [nfc] Add 'is' in diagnostic message. 2023-02-20 17:48:08 -08:00
zoecarver
c0416b1450 [cxx-interop] Tests for the recent diganostics and fix-its. 2023-02-20 15:58:38 -08:00
zoecarver
9d1d03124b [nfc][cxx-interop] Add diagnostics when something cannot be imported. 2022-07-18 17:15:15 -04:00