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

[DDMD] Issue 13707 - msvc32 C++ struct return ABI not followed for structs with constructors #4124

Merged
merged 1 commit into from
Nov 10, 2014

Conversation

yebblies
Copy link
Member

A constructor should stop a struct from being passed in registers on win32/C++.

https://issues.dlang.org/show_bug.cgi?id=13707

@yebblies yebblies changed the title Issue 13707 - msvc32 C++ struct return ABI not followed for structs with constructors [DDMD] Issue 13707 - msvc32 C++ struct return ABI not followed for structs with constructors Nov 10, 2014
@yebblies yebblies added the DDMD label Nov 10, 2014
…ts with constructors

A constructor should stop a struct from being passed in registers on win32/C++.
@MartinNowak
Copy link
Member

Auto-merge toggled on

@@ -914,6 +914,15 @@ RET retStyle(TypeFunction *tf)
//printf(" 2 RETstack\n");
return RETstack; // 32 bit C/C++ structs always on stack
}
if (global.params.isWindows && tf->linkage == LINKcpp && !global.params.is64bit &&
sd->isPOD() && sd->ctor)
Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't that also apply to LINKc?

Yes and no. The corresponding C declaration of course doesn't have a constructor, but an extern "C" C++ function does... I'm not really sure which way to go on this, so sticking with the current behavior seems safe.

MartinNowak added a commit that referenced this pull request Nov 10, 2014
[DDMD] Issue 13707 - msvc32 C++ struct return ABI not followed for structs with constructors
@MartinNowak MartinNowak merged commit 452cfcc into dlang:master Nov 10, 2014
@yebblies yebblies deleted the issue13707 branch November 10, 2014 14:46
@yebblies
Copy link
Member Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants