-
Notifications
You must be signed in to change notification settings - Fork 13.6k
static lambda call operator is not convertible to function pointer on win32 #62594
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
Labels
c++
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
confirmed
Verified by a second party
lambda
C++11 lambda expressions
platform:windows
Comments
@llvm/issue-subscribers-c-1 |
@llvm/issue-subscribers-clang-frontend |
@llvm/issue-subscribers-c-2b |
It took me a moment to spot it, but this is a 32-bit only issue: https://godbolt.org/z/P5zddjE43 |
faisalv
added a commit
that referenced
this issue
Sep 16, 2023
…tion pointer on win32 See issue #62594 This code does not work on win32: auto lstatic = []() static { return 0; }; int (*f2)(void) = lstatic; Since a calling convention such as CC_X86ThisCall can rightly interfere with the implicit pointer to function conversion if erroneously marked on a static function, the fix entails checking the 'static' specifier on the lambda declarator prior to assigning it a calling convention of an non-static member (which pre-c++23 made sense).
ZijunZhaoCCK
pushed a commit
to ZijunZhaoCCK/llvm-project
that referenced
this issue
Sep 19, 2023
…tion pointer on win32 See issue llvm#62594 This code does not work on win32: auto lstatic = []() static { return 0; }; int (*f2)(void) = lstatic; Since a calling convention such as CC_X86ThisCall can rightly interfere with the implicit pointer to function conversion if erroneously marked on a static function, the fix entails checking the 'static' specifier on the lambda declarator prior to assigning it a calling convention of an non-static member (which pre-c++23 made sense).
zahiraam
pushed a commit
to tahonermann/llvm-project
that referenced
this issue
Oct 24, 2023
…tion pointer on win32 See issue llvm#62594 This code does not work on win32: auto lstatic = []() static { return 0; }; int (*f2)(void) = lstatic; Since a calling convention such as CC_X86ThisCall can rightly interfere with the implicit pointer to function conversion if erroneously marked on a static function, the fix entails checking the 'static' specifier on the lambda declarator prior to assigning it a calling convention of an non-static member (which pre-c++23 made sense).
zahiraam
pushed a commit
to tahonermann/llvm-project
that referenced
this issue
Oct 24, 2023
…tion pointer on win32 See issue llvm#62594 This code does not work on win32: auto lstatic = []() static { return 0; }; int (*f2)(void) = lstatic; Since a calling convention such as CC_X86ThisCall can rightly interfere with the implicit pointer to function conversion if erroneously marked on a static function, the fix entails checking the 'static' specifier on the lambda declarator prior to assigning it a calling convention of an non-static member (which pre-c++23 made sense).
Fixed in Clang 18 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
c++
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
confirmed
Verified by a second party
lambda
C++11 lambda expressions
platform:windows
This code does not work with clang compiled with msvc.
I am working on a quick patch to fix it (the wrong calling convention
CC_X86ThisCall
is getting assigned in spite of thestatic
).The text was updated successfully, but these errors were encountered: