Skip to content

[cxx-interop] Add support for C++ comparison operators. #32351

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

Merged
merged 2 commits into from
Jun 18, 2020

Conversation

zoecarver
Copy link
Contributor

Adds support for C++ operators: <, >, ==, !=, <=, and >=.

@zoecarver zoecarver added the c++ interop Feature: Interoperability with C++ label Jun 12, 2020
@zoecarver zoecarver requested review from gribozavr and MForster June 12, 2020 18:14
@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test

case clang::OverloadedOperatorKind::OO_EqualEqual:
case clang::OverloadedOperatorKind::OO_ExclaimEqual:
case clang::OverloadedOperatorKind::OO_LessEqual:
case clang::OverloadedOperatorKind::OO_GreaterEqual:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep this list (and also the test cases) in the same order as https://github.com/llvm/llvm-project/blob/master/clang/include/clang/Basic/OperatorKinds.def#L58,L104?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I did this as a separate commit.

Adds support for C++ operators: `<`, `>`, `==`, `!=`, `<=`, and `>=`.
Re-order operator case statements and tests. The order now follows the order defined in `llvm-project/clang/include/clang/Basic/OperatorKinds.def`.

Also, adds operator character(s) in parentheses.
@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test and merge.

2 similar comments
@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test and merge.

@zoecarver
Copy link
Contributor Author

@swift-ci please smoke test and merge.

@swift-ci swift-ci merged commit 5bdc5cc into swiftlang:master Jun 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants