Swift does not export operator overloads to C++ #79433
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
c++ interop
Feature: Interoperability with C++
swift to c++
Feature → c++ interop: swift to c++
Description
While compiling a swift module to a C++ library and header file, operator overloads defined on public structs were not exported to C++.
Given the fact that C++ has support for operator overloading similar to how it's done in Swift, I was expecting it would simply be mapped to the C++ header, just like other functionality is. However, that was not the case.
Reproduction
clang++ main.cc -L Vector.lib -lVector -std=c++14 -o vector # If on windows add .exe
The final command failed with the following error:
Expected behavior
The following code should work and provide a value of
3
Environment
Swift version 6.0.2 (swift-6.0.2-RELEASE)
Additional information
No response
The text was updated successfully, but these errors were encountered: