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 22253 - ImportC expressions inadvertently supporting D properties #13066

Merged
merged 1 commit into from Sep 14, 2021

Conversation

WalterBright
Copy link
Member

The idea here is to prevent the compiler from looking up properties for C structs. Unfortunately, the property code lookup is a byzantine mess. So, what this fix does is short-circuit the mess and do its own lookup in importc.d.

A future PR could add spell checking to it.

@WalterBright WalterBright added the ImportC Pertaining to ImportC support label Sep 11, 2021
@dlang-bot
Copy link
Contributor

dlang-bot commented Sep 11, 2021

Thanks for your pull request, @WalterBright!

Bugzilla references

Auto-close Bugzilla Severity Description
22253 normal ImportC expressions inadvertently supporting D properties

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#13066"

@@ -9,7 +9,7 @@ struct S *abc = &(struct S){ 1, 2 };
int test()
{
struct S *var = &(struct S){ 1, 2 };
return var.b;
return var->b;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-_-

@RazvanN7
Copy link
Contributor

Could you please create a bugzilla entry and link it to this PR?

@RazvanN7 RazvanN7 added the Needs Bug Report PR needs to link to and/or create a bug report label Sep 13, 2021
@ibuclaw
Copy link
Member

ibuclaw commented Sep 13, 2021

What's up with this PR title?

@WalterBright WalterBright changed the title https://dlang.org/spec/expression.html#cat_expressions fix Issue 22253 - ImportC expressions inadvertently supporting D properties Sep 14, 2021
@WalterBright WalterBright added auto-merge and removed Needs Bug Report PR needs to link to and/or create a bug report labels Sep 14, 2021
@dlang-bot dlang-bot merged commit 602d0b1 into dlang:stable Sep 14, 2021
@maxhaton
Copy link
Member

@ibuclaw @WalterBright looks like this may have caused this https://issues.dlang.org/show_bug.cgi?id=22322

@WalterBright WalterBright deleted the fix22253 branch September 21, 2021 07:30
@WalterBright
Copy link
Member Author

@maxhaton it's not really the cause, but it triggered it. Here's the fix: #13091

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
5 participants