Thread overview
[Issue 19499] __c_long_double brake template specialization
Dec 21, 2018
Walter Bright
Dec 21, 2018
Walter Bright
Dec 21, 2018
Walter Bright
Dec 22, 2018
Walter Bright
Dec 22, 2018
Walter Bright
[Issue 19499] __c_long_double has exact match with double
Dec 22, 2018
Walter Bright
Dec 22, 2018
Walter Bright
December 18, 2018
https://issues.dlang.org/show_bug.cgi?id=19499

Илья Ярошенко <ilyayaroshenko@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |industry, rejects-valid

--
December 21, 2018
https://issues.dlang.org/show_bug.cgi?id=19499

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|---                         |WONTFIX

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
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.

--
December 21, 2018
https://issues.dlang.org/show_bug.cgi?id=19499

Илья Ярошенко <ilyayaroshenko@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |---

--- Comment #2 from Илья Ярошенко <ilyayaroshenko@gmail.com> ---
(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.

--
December 21, 2018
https://issues.dlang.org/show_bug.cgi?id=19499

--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> ---
ok

--
December 21, 2018
https://issues.dlang.org/show_bug.cgi?id=19499

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
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)

--
December 22, 2018
https://issues.dlang.org/show_bug.cgi?id=19499

--- Comment #5 from Walter Bright <bugzilla@digitalmars.com> ---
This was caused by:

https://github.com/dlang/dmd/pull/8632

Specifically, the lines in mtype.d:

    if (tob)
        return implicitConvTo(tob);

--
December 22, 2018
https://issues.dlang.org/show_bug.cgi?id=19499

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=19201

--
December 22, 2018
https://issues.dlang.org/show_bug.cgi?id=19499

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|__c_long_double brake       |__c_long_double has exact
                   |template specialization     |match with double

--
December 22, 2018
https://issues.dlang.org/show_bug.cgi?id=19499

--- Comment #6 from Walter Bright <bugzilla@digitalmars.com> ---
https://github.com/dlang/dmd/pull/9117

--
December 28, 2018
https://issues.dlang.org/show_bug.cgi?id=19499

--- Comment #7 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/e265d0c5dfc669cea1755c117d0d94e59b962077 fix Issue 19499 - __c_long_double has exact match with double

https://github.com/dlang/dmd/commit/7581ed9d6f265f7bcd748656c3c7abb856500826 Merge pull request #9117 from WalterBright/fix19499

fix Issue 19499 - __c_long_double has exact match with double merged-on-behalf-of: Iain Buclaw <ibuclaw@gdcproject.org>

--