Jump to page: 1 2
Thread overview
[Issue 15579] extern(C++) interfaces/multiple-inheritance
[Issue 15579] extern(C++) interfaces/multiple-inheritence
Jan 18, 2016
Manu
Jan 19, 2016
deadalnix
Jan 21, 2016
Walter Bright
Jan 22, 2016
Walter Bright
Jan 22, 2016
Walter Bright
Jan 22, 2016
Walter Bright
Jan 23, 2016
Manu
Jan 23, 2016
Manu
Jan 24, 2016
Walter Bright
Jan 24, 2016
Walter Bright
Jan 29, 2023
Iain Buclaw
January 18, 2016
https://issues.dlang.org/show_bug.cgi?id=15579

Manu <turkeyman@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |C++

--
January 19, 2016
https://issues.dlang.org/show_bug.cgi?id=15579

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei@erdani.com
            Summary|extern(C++)                 |extern(C++)
                   |interfaces/multiple-inherit |interfaces/multiple-inherit
                   |ence                        |ance

--
January 19, 2016
https://issues.dlang.org/show_bug.cgi?id=15579

deadalnix <deadalnix@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |deadalnix@gmail.com

--- Comment #1 from deadalnix <deadalnix@gmail.com> ---
https://mentorembedded.github.io/cxx-abi/abi.html#vtable

--
January 21, 2016
https://issues.dlang.org/show_bug.cgi?id=15579

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com

--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> ---
Compilable D version of the code:

  extern (C++)
  {
    class Base
    {
        ~this() {}
        size_t x = 4;
    }

    interface Interface
    {
        int Method();
    }

    class Derived : Base, Interface
    {
        size_t y = 5;
        int Method() { return 3; }
    }
  }

The layout for Win64 Base is:

  4Base6__initZ:
    void* &vtbl
    size_t x;


The layout for Win64 Derived is:

  7Derived6__initZ:
    void* &vtbl
    size_t x;
    size_t y;
    void* &vtbl

These can be figured out by running obj2asm on the object file and looking at it.

--
January 22, 2016
https://issues.dlang.org/show_bug.cgi?id=15579

--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> ---
https://github.com/D-Programming-Language/dmd/pull/5361

--
January 22, 2016
https://issues.dlang.org/show_bug.cgi?id=15579

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
https://issues.dlang.org/show_bug.cgi?id=15589 remains, though.

--
January 22, 2016
https://issues.dlang.org/show_bug.cgi?id=15579

--- Comment #5 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/316f2e900dc16ce1351a305c58bad287b2855ad5 fix Issue 15579 - extern(C++) interfaces/multiple-inheritance

https://github.com/D-Programming-Language/dmd/commit/c6ac10aed0f7dc76112e576204e3a1e8ea307dbd Merge pull request #5361 from WalterBright/fix15579

fix Issue 15579 - extern(C++) interfaces/multiple-inheritance

--
January 22, 2016
https://issues.dlang.org/show_bug.cgi?id=15579

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
January 22, 2016
https://issues.dlang.org/show_bug.cgi?id=15579

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
           Hardware|All                         |x86_64
         Resolution|FIXED                       |---
                 OS|All                         |Windows
           Severity|enhancement                 |normal

--- Comment #6 from Walter Bright <bugzilla@digitalmars.com> ---
Reopened because the fix for Win64 is incomplete.

--
January 23, 2016
https://issues.dlang.org/show_bug.cgi?id=15579

--- Comment #7 from Manu <turkeyman@gmail.com> ---
I was just doing some work with the latest nightly (should have this patch in
it).
I got a compile error that's new since the last nightly I was using:

3>Building bin\Debug_x64\dplug.dll...
3>libdep.lib(component_344_d5.obj) : fatal error LNK1179: invalid or corrupt
file: duplicate COMDAT '??1Component@ep@@QEAA@XZ'

The project structure is:
  cpplib.lib --+
  dlib.lib ----|
               |
           dplug.dll

So, cpplib has the stuff I'm extern-ing to, dlib is a binding to cpplib with
some adaptation support code, and dplug is a dll which links both libs.
dlib is mostly extern(C++)'s, and a bunch of extra (mostly extern(D)) code for
adaptation.
I presume that symbol exists in cpplib, but the error suggests that D is also
emitting the same symbol somewhere?


Possibly uninteresting, but I have a lot of code like this:

extern(C++) class CppClass
{
  void cppMethod(ref const(CustomString) &s);
  void cppMethod2();

extern(D):
  void dAdapterMethod(const(char)[] s) { auto temp = CustomString(s.ptr,
s.length); cppMethod(temp); }
}

This is a simple example, but there's a lot of this going on... so the
extern(C++) classes are kitted out with a bunch of extra functions on the D
side.
I only say this, because I wonder if the fact that I'm not strictly binding,
but also extending may lead to symbols being emitted...

--
« First   ‹ Prev
1 2