mrousavy/swift-cxx-link-bug-repro — explained in plain English
Analysis updated 2026-08-04 · repo last pushed 2026-04-28
Reproduce the Swift C++20 equality linking bug to confirm you are hitting the same issue.
Reference the included workaround to fix build failures when bridging Swift with modern C++20 structs.
Provide a minimal test case to the Swift compiler team when reporting related cross-language issues.
| mrousavy/swift-cxx-link-bug-repro | jacob-matthew-cook/distribution | netbirdio/freebsd-ports | |
|---|---|---|---|
| Stars | 2 | 3 | 1 |
| Language | Makefile | Makefile | Makefile |
| Last pushed | 2026-04-28 | — | 2026-03-15 |
| Maintenance | Maintained | — | Maintained |
| Setup difficulty | easy | hard | moderate |
| Complexity | 1/5 | 4/5 | 3/5 |
| Audience | developer | general | ops devops |
Figures from each repo's GitHub metadata at analysis time.
Requires a Swift toolchain and a C++20-capable compiler to reproduce the bug, but the project itself is a minimal Makefile-based test case.
This repository is a bug report, not a usable tool. It exists to demonstrate a specific flaw in how Swift interacts with C++ code, filed as an issue against the Swift compiler itself. The author created it to give the Swift team a minimal, easy-to-test example of a problem that causes projects to fail when they try to mix the two languages. The problem happens when Swift tries to compare two C++ objects for equality. C++20 introduced a clean, standard way to write equality checks inside a struct definition. However, when Swift code tries to use that standard equality check, the build process breaks because the final linking step cannot find the underlying comparison code. The project simply will not build, even though the C++ code is perfectly valid and follows modern conventions. The repository includes a small test case that triggers the failure, along with a documented workaround. This matters to developers building cross-language features, especially in the React Native ecosystem. The author specifically mentions that this bug affects react-native-vision-camera, a popular camera library, as well as code generators that automatically create C++ structs. Anyone writing Swift code that bridges into modern C++20 libraries could run into this build failure without warning. The workaround involves writing the equality check in a slightly different, older C++ style rather than the clean modern default. That fixes the build, but it is a friction point for developers who expect their modern, standards-compliant C++ to work seamlessly with Swift. The project itself is just a diagnostic tool, not something you would build upon.
A minimal test project that reproduces a Swift compiler bug where Swift fails to link C++20 struct equality checks. It exists to help the Swift team diagnose and fix the cross-language build failure.
Mainly Makefile. The stack also includes Swift, C++20, Makefile.
Maintained — commit in last 6 months (last push 2026-04-28).
No license information is provided in this repository, as it is a bug reproduction rather than a usable library.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.