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.
(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