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 21208 - C/C++ header generation for {string,enum} enums #11642

Merged
merged 2 commits into from
Aug 30, 2020

Conversation

wilzbach
Copy link
Member

Split-off from #11575

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Auto-close Bugzilla Severity Description
21208 normal [ICE] dtoh with enums

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 "master + dmd#11642"

@Geod24
Copy link
Member

Geod24 commented Aug 29, 2020

Could you add a test for:

struct Foo { int i; }
enum MyEnum { A = Foo(42), B = Foo(84) }

Otherwise LGTM

@wilzbach
Copy link
Member Author

Could you add a test for:

struct Foo { int i; }
enum MyEnum { A = Foo(42), B = Foo(84) }

Otherwise LGTM

Sure. Added.

@wilzbach
Copy link
Member Author

@thewilsonator FYI: I added another test to cover both cases Foo being extern(D) and extern(C++).

@thewilsonator
Copy link
Contributor

I'll leave merging to you then.

ENUM_CONSTANT(STC, STC_D, (STC)3)

// ignoring non-cpp struct Foo because of linkage
BEGIN_ENUM_TYPE(Foo, MyEnum, MYENUM, myenum)
Copy link
Member Author

Choose a reason for hiding this comment

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

This doesn't make much sense, but I added it to check that there's at least no segfault.

@wilzbach wilzbach merged commit 6cd107f into dlang:master Aug 30, 2020
@wilzbach wilzbach deleted the fix-dtoh branch August 30, 2020 14:54
@ibuclaw ibuclaw added the Feature:dtoh C++ header generation label Sep 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants