Comment #0 by ilyayaroshenko — 2018-12-18T15:59:41Z
// Mircrosoft C Runtime
import core.stdc.config;
enum A(T : double) = true;
enum A(T : __c_long_double) = false;
pragma(msg, A!double); // Error in 2.083, compiles in 2.082
The pattern is used in Mir for integration with Python.
Comment #1 by bugzilla — 2018-12-21T08:01:37Z
The error message is:
Error: undefined identifier __c_long_double, did you mean alias c_long_double?
In general, avoid using names prefixed by __, as they are reserved for the compiler. Change it to c_long_double, and it will compile.
Comment #2 by ilyayaroshenko — 2018-12-21T08:16:37Z
(In reply to Walter Bright from comment #1)
> The error message is:
>
> Error: undefined identifier __c_long_double, did you mean alias
> c_long_double?
>
> In general, avoid using names prefixed by __, as they are reserved for the
> compiler. Change it to c_long_double, and it will compile.
No, as was mentioned in the issue it is for Microsoft runtime and looks like you compile the code with DigitalMars runtime.
https://github.com/dlang/druntime/blob/master/src/core/stdc/config.d#L156
----
version (CRuntime_Microsoft)
{
enum __c_long_double : double;
alias __c_long_double c_long_double;
}
else version (DigitalMars)
-----
as you can see it does not matter what to use in the issue: __c_long_double or c_long_double. __c_long_double was used because it appears in the compiler error msg.
Comment #3 by bugzilla — 2018-12-21T11:05:27Z
ok
Comment #4 by bugzilla — 2018-12-21T23:44:29Z
A self-contained test case:
enum __c_long_double : double;
enum A(T : double) = true;
enum A(T : __c_long_double) = false;
pragma(msg, A!double);
test.d(6): Error: template test.A matches more than one template declaration:
test.d(4): A(T : double)
and
test.d(5): A(T : __c_long_double)
test.d(6): while evaluating pragma(msg, A!double)