Bug 23017 – C++ class may not derive from D class

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-14T20:42:22Z
Last change time
2022-04-17T23:17:35Z
Keywords
pull
Assigned to
No Owner
Creator
naydef

Comments

Comment #0 by naydef — 2022-04-14T20:42:22Z
Code: ``` class Parent { } extern(C++) class Child : Parent { } ``` This code crashes LDC. The response was this code is invalid and should be rejected. https://github.com/ldc-developers/ldc/issues/3959
Comment #1 by dkorpel — 2022-04-15T08:46:09Z
It's indeed not valid: https://dlang.org/spec/cpp_interface.html#classes > Unlike classes and interfaces with D linkage, extern (C++) classes and interfaces are not rooted in Object and cannot be used with typeid.
Comment #2 by dlang-bot — 2022-04-15T08:48:50Z
@dkorpel created dlang/dmd pull request #13984 "Fix issue 23017 - C++ class may not derive from D class" fixing this issue: - Fix issue 23017 - C++ class may not derive from D class https://github.com/dlang/dmd/pull/13984
Comment #3 by dlang-bot — 2022-04-17T23:17:35Z
dlang/dmd pull request #13984 "Fix issue 23017 - C++ class may not derive from D class" was merged into master: - 06d9c42d52ab05e8eaecbd18468acce352b255c3 by Dennis Korpel: Fix issue 23017 - C++ class may not derive from D class https://github.com/dlang/dmd/pull/13984