BitwiseCopyable
attribute on C struct leads to compiler crash
#78368
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
crash
Bug: A crash, i.e., an abnormal termination of software
triage needed
This issue needs more specific labels
Description
The test case here works fine:
swift/test/Sema/bitwse_copyable_import.swift
Lines 56 to 60 in 55189ba
... but removing that
int is[]
flexible array member leads to a crash. Oddly, the compiler only crashes if you instantiate a value of the type, not if you declare it as a param, declare it as a return value, or pass it as an argument.Reproduction
In an imported C library:
Swift code that uses it:
Here is a minimal SPM project I made that reproduces it, that takes care of setting up the main Swift executable target, with a C library as a dependency. https://github.com/amomchilov/BitwiseCopyableUnions/tree/compiler-crasher
Stack dump
Expected behavior
Not crash.
Environment
Apple Swift version 6.0.3 (swiftlang-6.0.3.1.10 clang-1600.0.30.1)
Target: arm64-apple-macosx15.0
Additional information
No response
The text was updated successfully, but these errors were encountered: