[all-commits] [llvm/llvm-project] 5bdd5d: Fix PR#62594 : static lambda call operator is not ...
Faisal Vali via All-commits
all-commits at lists.llvm.org
Sat Sep 16 11:30:16 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5bdd5d064d5171b2d5ff6268528cfffd2f86b8ea
https://github.com/llvm/llvm-project/commit/5bdd5d064d5171b2d5ff6268528cfffd2f86b8ea
Author: faisal vali <faisalv at yahoo.com>
Date: 2023-09-16 (Sat, 16 Sep 2023)
Changed paths:
M clang/docs/ReleaseNotes.rst
M clang/lib/Sema/SemaType.cpp
A clang/test/SemaCXX/cxx23-static-callop-lambda-expression.cpp
Log Message:
-----------
Fix PR#62594 : static lambda call operator is not convertible to function pointer on win32
See issue https://github.com/llvm/llvm-project/issues/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).
More information about the All-commits
mailing list