Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cxx-interop] Out-of-line overloaded operators are printed twice in the module interface #62727

Open
egorzhdan opened this issue Dec 21, 2022 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. c++ interop Feature: Interoperability with C++ compiler The Swift compiler in itself textual interfaces

Comments

@egorzhdan
Copy link
Collaborator

egorzhdan commented Dec 21, 2022

See test/Interop/Cxx/namespace/Inputs/free-functions.h:

namespace FunctionsNS1 {
struct X {};
inline const char *operator+(X, X) { return "FunctionsNS1::operator+(X, X)"; }
}

In the generated module interface, operator+ is printed twice: once as a member of enum FunctionsNS1, and once again as a global function. The operator is actually imported as a global function, and Swift should only print it as a global function.

(test/Interop/Cxx/namespace/free-functions-module-interface.swift)

@egorzhdan egorzhdan added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. c++ interop Feature: Interoperability with C++ labels Dec 21, 2022
@AnthonyLatsis AnthonyLatsis added compiler The Swift compiler in itself textual interfaces labels Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. c++ interop Feature: Interoperability with C++ compiler The Swift compiler in itself textual interfaces
Projects
None yet
Development

No branches or pull requests

2 participants