Bug 21218 – dtoh: protection attributes should be emitted to headers

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2020-09-03T21:12:15Z
Last change time
2020-10-15T07:29:06Z
Keywords
bootcamp, pull
Assigned to
No Owner
Creator
Seb

Comments

Comment #0 by greeenify — 2020-09-03T21:12:15Z
``` extern(C++) struct Foo { protected int a = 1; } ``` generates currently: ``` struct Foo { int32_t a; Foo() {} }; ``` expected: ``` struct Foo { protected int32_t a; Foo() {} }; ```
Comment #1 by greeenify — 2020-09-03T21:14:55Z
This also applies to `private` and likely all other protection attributes: ``` extern(C++) struct Foo { private int a = 1; } ``` generates currently: ``` struct Foo { int32_t a; Foo() {} }; ```
Comment #2 by dlang-bot — 2020-09-28T11:11:08Z
@MoonlightSentinel created dlang/dmd pull request #11804 "Fix 21218 - protection attributes should be emitted to C++ headers" fixing this issue: - Fix 21218 - protection attributes should be emitted to C++ headers Properly track the current protection while writing struct/class members and add `public:`, `protected:` or `private:` as necessary. `package` and `package(...)` is currently mapped to `protected` as there is no real equivalent in C++. https://github.com/dlang/dmd/pull/11804
Comment #3 by dlang-bot — 2020-10-15T07:29:06Z
dlang/dmd pull request #11804 "Fix 21218 - protection attributes should be emitted to C++ headers" was merged into master: - f0ebacdb3b8e91cbeb42ed86f2123dada7f68658 by MoonlightSentinel: Fix 21218 - protection attributes should be emitted to C++ headers Properly track the current protection while writing struct/class members and add `public:`, `protected:` or `private:` as necessary. `package` and `package(...)` is currently mapped to `protected` as there is no real equivalent in C++. https://github.com/dlang/dmd/pull/11804