Bug 19014 – Compiler imports symbols that aren't actually imported.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-06-22T01:43:37Z
Last change time
2018-12-10T00:53:51Z
Assigned to
No Owner
Creator
Mike Franklin
See also
https://issues.dlang.org/show_bug.cgi?id=19471

Comments

Comment #0 by slavo5150 — 2018-06-22T01:43:37Z
The following code works as expected: --- Example 1 void main() { if (true) { static import core.stdc.math; } static assert(!__traits(compiles, core.stdc.math.cos(0))); } --- The following code does not work as expected: --- Example 2 import core.stdc.config; void main() { if (true) { static import core.stdc.math; } static assert(!__traits(compiles, core.stdc.math.cos(0))); } --- When importing `core.stdc.config` it also appears to import `core.stdc.math` although `core.stdc.config` does not import anything.
Comment #1 by schveiguy — 2018-06-22T02:14:20Z
I think this has something to do with intrinsics.
Comment #2 by slavo5150 — 2018-06-22T23:47:51Z
Compiling with head I get the following: Deprecation: module core.stdc.math is not accessible here, perhaps add static import core.stdc.math; So, I believe this issue will be solved when the deprecation phase has passed.
Comment #3 by razvan.nitu1305 — 2018-07-02T10:35:41Z
(In reply to Mike Franklin from comment #2) > Compiling with head I get the following: > > Deprecation: module core.stdc.math is not accessible here, perhaps add > static import core.stdc.math; > > So, I believe this issue will be solved when the deprecation phase has > passed. So, can we close this?
Comment #4 by slavo5150 — 2018-07-02T10:54:18Z
I don't want to close it until a test is added to the DMD test suite and it passes. We can't do that until the deprecation period has expired.
Comment #5 by razvan.nitu1305 — 2018-07-02T12:37:30Z
(In reply to Mike Franklin from comment #4) > I don't want to close it until a test is added to the DMD test suite and it > passes. We can't do that until the deprecation period has expired. A compilable test with the REQUIRED_ARGS set to -de can be added in order to solve this.
Comment #6 by slavo5150 — 2018-07-03T02:00:58Z
This issue is currently blocking https://github.com/dlang/druntime/pull/2222 I don't want to close this until that change is possible. It's not currently possible because the compiler does not emit an error for the scenario in Comment #0. After the deprecation period has expired, we can emit a compiler error, and then we can continue with https://github.com/dlang/druntime/pull/2222 I don't want to close this until https://github.com/dlang/druntime/pull/2222 can be implemented.
Comment #7 by razvan.nitu1305 — 2018-07-03T08:41:08Z
https://github.com/dlang/dmd/pull/8443 : turns deprecation into error
Comment #8 by slavo5150 — 2018-07-03T09:01:59Z
(In reply to RazvanN from comment #7) > https://github.com/dlang/dmd/pull/8443 : turns deprecation into error Thank you, I tested locally, and that appears to resolve this issue. I believe this can be closed when that is merged. For some reason I though we had to wait a year before changing that to an error.
Comment #9 by razvan.nitu1305 — 2018-07-03T09:07:04Z
(In reply to Mike Franklin from comment #8) > (In reply to RazvanN from comment #7) > > https://github.com/dlang/dmd/pull/8443 : turns deprecation into error > > Thank you, I tested locally, and that appears to resolve this issue. I > believe this can be closed when that is merged. For some reason I though we > had to wait a year before changing that to an error. Normally, the deprecation period is one year, but in this case the deprecation was introduced in february 2016 (2 years and 4 months ago).
Comment #10 by github-bugzilla — 2018-12-09T13:54:17Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/00b990f8f96903a1fc6264c678fef6a58542f0c2 Fix Issue 19014 - Compiler imports symbols that aren't actually imported https://github.com/dlang/dmd/commit/3d8663595c143e925195b9eec9cea96f88c8d213 Merge pull request #9050 from JinShil/fix_19014 Fix Issue 19014 - Compiler imports symbols that aren't actually imported merged-on-behalf-of: Nicholas Wilson <[email protected]>