Bug 22287 – ambiguous virtual function for extern(C++) under Windows

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2021-09-07T20:54:48Z
Last change time
2021-10-05T17:02:15Z
Keywords
C++, pull, rejects-valid
Assigned to
No Owner
Creator
Tim

Comments

Comment #0 by tim.dlang — 2021-09-07T20:54:48Z
The following does not compile under Windows with some compiler flags: extern(C++): class A { ~this(); } interface I { int f() const; } class B : A, I { override int f() const; } class C : B { override int f() const; } The code compiles under Linux with dmd -c test.d. Compiling it under Windows with dmd -m32mscoff -c test.d results in the following error: test.d(18): Error: class `test.C` ambiguous virtual function `f` test.d(18): Error: class `test.C` ambiguous virtual function `f` Using -m64 instead of -m32mscoff results in the same error. It can be successfully compiled under Windows with just dmd -c test.d, but I don't know if the resulting binary would work. All tests used dmd v2.097.2.
Comment #1 by dlang-bot — 2021-09-11T17:17:19Z
@tim-dlang created dlang/dmd pull request #13068 "fix Issue 22287 - ambiguous virtual function for extern(C++) under Wi…" fixing this issue: - fix Issue 22287 - ambiguous virtual function for extern(C++) under Windows https://github.com/dlang/dmd/pull/13068
Comment #2 by dlang-bot — 2021-10-05T17:02:15Z
dlang/dmd pull request #13068 "fix Issue 22287 - ambiguous virtual function for extern(C++) under Wi…" was merged into master: - 35255b114c1c2d6261a9fcb0366283c6bf4f19dc by Tim Schendekehl: fix Issue 22287 - ambiguous virtual function for extern(C++) under Windows https://github.com/dlang/dmd/pull/13068