Skip to content

Fix Issue 21217 - C++ header generator shouldn't emit private enums#11679

Merged
Geod24 merged 1 commit intodlang:masterfrom
wilzbach:fix-21217
Sep 4, 2020
Merged

Fix Issue 21217 - C++ header generator shouldn't emit private enums#11679
Geod24 merged 1 commit intodlang:masterfrom
wilzbach:fix-21217

Conversation

@wilzbach
Copy link
Contributor

@wilzbach wilzbach commented Sep 3, 2020

Required for #11640

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Auto-close Bugzilla Severity Description
21217 major C++ header generator shouldn't emit private 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#11679"

@MoonlightSentinel
Copy link
Contributor

MoonlightSentinel commented Sep 3, 2020

Not sure about protected enums, Why should they not be accessible across language barriers?

@wilzbach
Copy link
Contributor Author

wilzbach commented Sep 3, 2020

Not sure about protected enums, Why should they not be accessible across language barriers?

From the docs:

protected only applies inside classes (and templates as they can be mixed in) and means that a symbol can only be seen by members of the same module, or by a derived class. If accessing a protected instance member through a derived class member function, that member can only be accessed for the object instance which can be implicitly cast to the same type as ‘this’. protected module members are illegal. (https://dlang.org/spec/attribute.html#visibility_attributes)

My reasoning:

So I would feel more comfortable emitting protected enums if protected variables were a thing in dtoh, but AFAICT everything emitted is public.

@MoonlightSentinel
Copy link
Contributor

MoonlightSentinel commented Sep 3, 2020

So I would feel more comfortable emitting protected enums if protected variables were a thing in dtoh, but AFAICT everything emitted is public.

Fair enough, this shouldn't be a real breaking change given the state of the header generator. But it needs to be re-enabled once the generator properly emits protection levels.

@Geod24 Geod24 merged commit 2da5ecb into dlang:master Sep 4, 2020
@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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants