[Issue 19134] [C++] static const y = new Derived(); ->pointer cast from const(Derived) to immutable(void*)** is not supported at compile time

2018-08-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19134

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 19134] [C++] static const y = new Derived(); ->pointer cast from const(Derived) to immutable(void*)** is not supported at compile time

2018-08-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19134

--- Comment #4 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/b952c845f77264d40253e2e144625fdb0c301804
Fix Issue 19134

And revert to D vptr semantics in constructors of extern(C++) classes,
i.e., call the most derived override in base constructors. 2.081
introduced a breaking change here, using the most derived override
before the super() call and the current class' afterwards.

The proper mid-term solution is probably to emit fully C++-compatible
constructors for extern(C++) classes, calling the super ctor right at
the start and then blitting vptr and class-specific fields from the
init symbol. extern(C++) classes (and structs) should get an implicit
default ctor (only if there's no other ctor in the class case).
extern(C++) classes could then be allocated and properly constructed via
C++ `new`; struct declarations in C++ headers for extern(C++) structs
wouldn't need to duplicate the field initializers and could simply
declare the default ctor (emitted by the D compiler and blitting the
init symbol).

https://github.com/dlang/dmd/commit/50833f0a98df9ac1f1c78db4dd24743aad300539
Merge pull request #8533 from kinke/fix19134

[stable] Fix Issue 19134 - [C++] static const y = new Derived(); ->pointer cast
from const(Derived) to immutable(void*)** is not supported at compile time
merged-on-behalf-of: Rainer Schuetze 

--


[Issue 19134] [C++] static const y = new Derived(); ->pointer cast from const(Derived) to immutable(void*)** is not supported at compile time

2018-08-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19134

--- Comment #3 from ki...@gmx.net ---
https://github.com/dlang/dmd/pull/8533

--


[Issue 19134] [C++] static const y = new Derived(); ->pointer cast from const(Derived) to immutable(void*)** is not supported at compile time

2018-08-02 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19134

ki...@gmx.net changed:

   What|Removed |Added

 CC||ki...@gmx.net

--- Comment #2 from ki...@gmx.net ---
See https://github.com/dlang/dmd/pull/8362#pullrequestreview-142565787.

--


[Issue 19134] [C++] static const y = new Derived(); ->pointer cast from const(Derived) to immutable(void*)** is not supported at compile time

2018-08-01 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19134

--- Comment #1 from Nicholas Wilson  ---
I forgot to replace all of the Ys with Derived.

--