-
-
Notifications
You must be signed in to change notification settings - Fork 672
Fix Issue 18955 - extern(C++) default struct mangling is overridden when interacting with a cppmangle = class template #8631
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
Conversation
|
Thanks for your pull request, @JinShil! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#8631" |
|
There's some strange difference between Appveyor and the auto-tester. If I adjust the test to make Appveyor pass, then auto-tester fails. If I adjust the test to make the auto-tester pass, then Appveyor fails. Can anyone explain the discrepancy? |
|
I think this LGTM, but I didn't do it because I didn't understand the surrounding code enough to have confidence. It kinda looked like the original code was deliberate. |
|
auto-tester Win32_64 expects: auto-tester Win32 expects: appveyor (Win32 - I think) expects: There's no way I can satisfy that. Any idea why the auto-tester and appveyor expect different results? |
|
Did you get those mangled names from MSVC? It's not like DMC vs MSVC proper is it? |
|
I took them from the error messages generated by the auto-tester and Appveyor. I don't know which C++ compilers they are employing. |
|
I just tried MSVC2015, it emits: That's what we should expect... |
|
Thanks, Then it must be the auto-tester's Win32 host that's giving the wrong result. @braddr, Any ideas? |
|
autotester's Win32 test is the only server building with dmc. Looking at cppmanglewin.d, there's a flag |
This string doesn't demangle with UnDecorateSymbolName. |
|
auto-tester and Appveyor are all green now. Thank you, @rainers. |
|
DAutoTest failed, due to a timeout: Restarting... |
|
@JinShil, can you rebase to restart DAutoTest? |
|
@rainers is this PR good to go now? |
…hen interacting with a cppmangle = class template
Looks reasonable, but I'm not too familiar with the code. I wonder why the tests are limited to Windows (I know mangling for structs and classes only differs there, but something else might break on other platforms). Wouldn't it be better to actually try linking against the respective C++ code? |
The bug was specific to Windows. I could add a test for other platforms, but I'm not knowledgeable enough to know if the mangling produced is correct, so I may add a test that is verifying an incorrect result.
We need the C++ bindings created first. That's currently getting under way at dlang/druntime#2286. |
|
@TurkeyMan If you could write a test case that links to libstdc++, I'll incorporate it into the PR and extend the test to multiple platforms. |
|
I was rather thinking of adjusting the definition in cppa.d and add something matching in cppb.cpp:, e.g. rainers@194cdc1 That also matches the definition in |
|
@JinShil Writing any tests that link to stdc++ is super hard, since there are a lot of C++ tests that all use different C++ compilers, and different STL's, and most of the machinery to make correct decisions isn't merged yet (see my recent PR's). |
|
@JinShil https://godbolt.org/z/6QZzsf using MSVC 2015 |
|
Why isn't this merged? Is something holding it up? |
Maybe it's simpler to merge this and I make rainers@194cdc1 another PR? It might expose some non-Windows issues, though. |
|
@rainers sounds good, in this case feel free to approve and merge this PR. |
I'm not all that confident in this fix. If this isn't the right fix, please help me with some advise. Thanks.