-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] Do not emit IR for C++20 requires expr #65652
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
Conversation
@swift-ci please smoke test |
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beautiful, thank you!
lib/IRGen/GenClangDecl.cpp
Outdated
@@ -119,6 +119,10 @@ class ClangDeclFinder | |||
return true; | |||
} | |||
|
|||
bool TraverseRequiresExpr(clang::RequiresExpr *RE) { | |||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this should be true
. if you return false
the traversal exits early which will make us miss some symbols. Can you test that in your test? e.g. make your function call something else and make sure that's emitted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, thanks for noticing this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update traversal logic
8959f9f
to
0974fca
Compare
@swift-ci please smoke test |
@swift-ci please test |
0974fca
to
95da9ea
Compare
@swift-ci please smoke test |
This fixes a compiler crash when emitting IR for a for-in loop over a C++ `std::vector` in C++20 mode. rdar://108810356
95da9ea
to
21745e5
Compare
@swift-ci please smoke test |
@@ -0,0 +1,10 @@ | |||
// RUN: %target-swiftxx-frontend -emit-ir -Xcc -std=gnu++20 -I %S/Inputs %s | %FileCheck %s | |||
// | |||
// REQUIRES: OS=macosx |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a note saying why this needs macOS in C++ 20 mode . Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #65710
This fixes a compiler crash when emitting IR for a for-in loop over a C++
std::vector
in C++20 mode.rdar://108810356