Bug 18905 – [Reg 2.079] C++ classes can no longer be used with -betterC
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-05-24T21:17:07Z
Last change time
2018-05-29T18:11:40Z
Keywords
betterC, C++
Assigned to
No Owner
Creator
Walter Bright
Comments
Comment #0 by bugzilla — 2018-05-24T21:17:07Z
Consider:
extern (C++) class C { } // Error: TypeInfo cannot be used with -betterC
This worked with 2.074. TypeInfo with 2.074 was not generated for this class, it just generated the vtbl[] which is fine.
Looks like
https://github.com/dlang/dmd/pull/7799
is the culprit.
Comment #1 by bugzilla — 2018-05-24T21:18:29Z
When compiled with -betterC
Comment #2 by slavo5150 — 2018-05-25T01:09:55Z
My research tells me this never actually worked; it used to generate a linker error (1), then it generated a compiler error (2), and now HEAD is back to generated a linker error (3).
1) Linker error was introduced with this:
-----------------------------------------
digger: Installing phobos-9f82a92b46e4236a29fa7a2830bcb09b89f1bcc8-2719e623bb150701c1636102dce91965
digger: Copy: /home/mike/work/temp-cache/v3/phobos-9f82a92b46e4236a29fa7a2830bcb09b89f1bcc8-2719e623bb150701c1636102dce91965/lib -> /home/mike/work/build/lib
digger: Clearing temporary cache
digger: ---------------------- Running test command... -----------------------
digger: ------------- Test command exited with status 0 (GOOD). --------------
digger: Finding shortest path between f65fb48e26f32114834c3eed3b89037894d5fcf2 and 90a8a78ab27a27dcf2df757214f7bb13446ce191...
digger: 0 commits (about 0 tests) remaining.
digger: 90a8a78ab27a27dcf2df757214f7bb13446ce191 is the first bad commit
commit 90a8a78ab27a27dcf2df757214f7bb13446ce191
Author: The Dlang Bot <[email protected]>
Date: Mon Jun 26 23:19:46 2017 +0200
dmd: Merge pull request #6918 from WalterBright/link-betterC
https://github.com/dlang/dmd/pull/6918
fix Issue 17521 - -betterC programs should not link in Phobos by default
merged-on-behalf-of: Martin Nowak <[email protected]>
diff --git a/dmd b/dmd
index 47c0f9397..5a03f923f 160000
--- a/dmd
+++ b/dmd
@@ -1 +1 @@
-Subproject commit 47c0f9397144e6db1e56fcec1e6d512084f4f947
+Subproject commit 5a03f923fce98e9db6b3b563308b510c21ac5116
digger: Bisection completed successfully.
2) The compiler error was introduced with this:
-----------------------------------------------
https://github.com/dlang/dmd/pull/7799
...which was actually an improvement because prior to that PR, the compiler was expecting to find TypeInfo at link-time but was unable to. The compiler-time error at least gave notice that something was wrong before it got to the linker.
3) Linker error re-introduced with this:
----------------------------------------
digger: Installing phobos-42e9d6ffb9ec07cf2972d7d5932baae6aa60532c-039ab00227f1ab904b29ebf50fd56dad
digger: Copy: /home/mike/work/temp-cache/v3/phobos-42e9d6ffb9ec07cf2972d7d5932baae6aa60532c-039ab00227f1ab904b29ebf50fd56dad/lib -> /home/mike/work/build/lib
digger: Clearing temporary cache
digger: ---------------------- Running test command... -----------------------
digger: ------------- Test command exited with status 0 (GOOD). --------------
digger: Finding shortest path between 1904038db47e8710352c840956f95e8b08cf584f and 4a8b2c80efe6c3546b37d95fe7db7740a06bdfaf...
digger: 0 commits (about 0 tests) remaining.
digger: 4a8b2c80efe6c3546b37d95fe7db7740a06bdfaf is the first good commit
commit 4a8b2c80efe6c3546b37d95fe7db7740a06bdfaf
Author: The Dlang Bot <[email protected]>
Date: Fri Apr 27 11:34:39 2018 +0200
dmd: Merge pull request #8204 from JinShil/minimal_runtime_with_classes
https://github.com/dlang/dmd/pull/8204
Add ability to use interfaces and classes without the runtime if they only contain static members
merged-on-behalf-of: unknown
diff --git a/dmd b/dmd
index 7f94ffbab..40b18f0ab 160000
--- a/dmd
+++ b/dmd
@@ -1 +1 @@
-Subproject commit 7f94ffbab7328cdd643e0be5fbbb2b8ef580845f
+Subproject commit 40b18f0abfefc9aab0ff99e2d699c0bff7a4cf67
digger: Bisection completed successfully.
But all that is beside the point, isn't it. It should work with -betterC. I'm looking into it.