-
Notifications
You must be signed in to change notification settings - Fork 27
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
fix MakeFunctionCallable
's codegen when return type is a function pointer
#502
fix MakeFunctionCallable
's codegen when return type is a function pointer
#502
Conversation
64d02c5
to
3dcb1c8
Compare
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.
clang-tidy made some suggestions
@@ -920,6 +926,12 @@ TEST(FunctionReflectionTest, GetFunctionCallWrapper) { | |||
FCI4.Invoke(&ret4); | |||
EXPECT_EQ(ret4, 4); | |||
|
|||
typedef int (*int_func)(void); |
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.
warning: redundant void argument list in typedef [modernize-redundant-void-arg]
typedef int (*int_func)(void); | |
typedef int (*int_func)(); |
@@ -920,6 +926,12 @@ TEST(FunctionReflectionTest, GetFunctionCallWrapper) { | |||
FCI4.Invoke(&ret4); | |||
EXPECT_EQ(ret4, 4); | |||
|
|||
typedef int (*int_func)(void); | |||
int_func callback = nullptr; | |||
FCI5.Invoke(&callback); |
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.
warning: multilevel pointer conversion from 'int_func *' (aka 'int (**)()') to 'void *', please use explicit cast [bugprone-multi-level-implicit-pointer-conversion]
FCI5.Invoke(&callback);
^
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #502 +/- ##
==========================================
+ Coverage 71.26% 71.63% +0.36%
==========================================
Files 9 9
Lines 3564 3568 +4
==========================================
+ Hits 2540 2556 +16
+ Misses 1024 1012 -12
... and 1 file with indirect coverage changes
|
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.
Probably @aaronj0 should take a look.
3dcb1c8
to
2b096c7
Compare
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.
LGTM!
`test01_instance_data_read_access` fixed by compiler-research/cppyy-backend#128 (enum changes) others fixed by compiler-research/CPyCppyy#82 & compiler-research/CppInterOp#502
`test01_instance_data_read_access` fixed by compiler-research/cppyy-backend#128 (enum changes) others fixed by compiler-research/CPyCppyy#82 & compiler-research/CppInterOp#502
Description
Fixes code generation of
MakeFunctionCallable
for the cases where the return type of the function is a function pointer.Fixes # (issue)
Potentially fix 4 tests at cppyy.
Type of change
Please tick all options which are relevant.
Testing
Implemented a test case where it used to fail, but passed with these changes.
Checklist