Skip to content
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 Issue 22407 - importC: Error: cannot implicitly convert expression of type 'extern (C) int(int a)' to 'const(extern (C) int function(int))' #13182

Merged
merged 3 commits into from Oct 18, 2021

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Oct 17, 2021

If an initializer is an array or function symbol, and the target object is a pointer, then C11 6.3.2.1-4 conversion rules apply.

@ibuclaw ibuclaw added Bug Fix ImportC Pertaining to ImportC support labels Oct 17, 2021
@dlang-bot
Copy link
Contributor

dlang-bot commented Oct 17, 2021

Thanks for your pull request, @ibuclaw!

Bugzilla references

Auto-close Bugzilla Severity Description
22399 major importC: Error: static variable cannot be read at compile time
22400 critical importC: Error: unknown, when compiling source with typedef'd initializer
22407 major importC: Error: cannot implicitly convert expression of type 'extern (C) int(int a)' to 'const(extern (C) int function(int))'

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "stable + dmd#13182"

@ibuclaw ibuclaw force-pushed the issue22407 branch 2 times, most recently from 3068aa2 to 50da4f9 Compare October 17, 2021 23:47
@ibuclaw
Copy link
Member Author

ibuclaw commented Oct 17, 2021

With a tweak to the condition, this now fixes both issue 22399 and 22400.

@thewilsonator
Copy link
Contributor

please rebase

@ibuclaw
Copy link
Member Author

ibuclaw commented Oct 18, 2021

please rebase

I'll do one but the others'll have to wait a day.

@ibuclaw ibuclaw merged commit 58e4db9 into dlang:stable Oct 18, 2021
@ibuclaw ibuclaw deleted the issue22407 branch October 18, 2021 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge Bug Fix ImportC Pertaining to ImportC support
Projects
None yet
3 participants