-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] fix a clang assertion when synthesizing instance to sta… #76235
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 test |
…tic member call for operator () A specific static operator () in MSVC's STL triggers this assertion in clang when buidling CxxStdlib: Assertion failed: isInstance() && "No 'this' for static methods!", file S:\SourceCache\llvm-project\clang\lib\AST\DeclCXX.cpp, line 2544 When the return statement is being constructed using clang sema in Swift's function synthesis code. This change avoids using member call expression for a call to static operator (), and instead performs a direct call, which closer matches what Clang's semas typechecker expects, and the default Clang's parsing behavior as well. This fixes the windows toolchain build with MSVC.
a6451ed
to
16b0c2a
Compare
@swift-ci please test |
Hmm, I haven't seen this on the main branch before. Is this the same issue as something we've seen on rebranch: #75907? |
@swift-ci please test Windows platform |
@egorzhdan hmm, I think it is - and I do like your patch better. Could we cherry-pick that to main? |
Sure! I'll put up a PR within an hour |
@egorzhdan - could you please include the test case from this and ensure that still passes with your change? The one thing that I noticed is that you explicitly special cased |
Extracted from #76235. Co-authored-by: Alex Lorenz <[email protected]>
I just put up a PR: #76252 |
Thanks! |
Closing in favor of #76252 |
Extracted from swiftlang#76235. Co-authored-by: Alex Lorenz <[email protected]>
Extracted from swiftlang#76235. Co-authored-by: Alex Lorenz <[email protected]>
Extracted from swiftlang#76235. Co-authored-by: Alex Lorenz <[email protected]>
…tic member call for operator ()
A specific static operator () in MSVC's STL triggers this assertion in clang when buidling CxxStdlib: Assertion failed: isInstance() && "No 'this' for static methods!", file S:\SourceCache\llvm-project\clang\lib\AST\DeclCXX.cpp, line 2544 When the return statement is being constructed using clang sema in Swift's function synthesis code.
This change avoids using member call expression for a call to static operator (), and instead performs a direct call, which closer matches what Clang's semas typechecker expects, and the default Clang's parsing behavior as well.
This fixes the windows toolchain build with MSVC.