Thread overview
[Issue 8255] New: ICE when passing 'ref' literal
[Issue 8255] [CTFE] ICE when passing 'ref' literal
Jun 17, 2012
Kenji Hara
Sep 26, 2012
Don
Oct 07, 2013
Walter Bright
June 16, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8255

           Summary: ICE when passing 'ref' literal
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: wfunction@hotmail.com


--- Comment #0 from wfunction@hotmail.com 2012-06-16 15:47:50 PDT ---
struct G { }
struct F(T) { void f(ref T) { } }
pragma(msg, F!G().f(G.init));
void main() { }

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8255


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |CTFE, ice
           Platform|x86                         |All
            Summary|ICE when passing 'ref'      |[CTFE] ICE when passing
                   |literal                     |'ref' literal
         OS/Version|Windows                     |All


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-06-17 00:10:51 PDT ---
This is the CTFE problem on out of function scope.

struct G {}
struct F(T) { void f(ref T) {} }

pragma(msg, F!G().f(G.init));   // ICE
enum b = { F!G().f(G.init); return true; }();    // OK

void main()
{
    F!G().f(G.init);    // OK
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 26, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8255


Don <clugdbug@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug@yahoo.com.au
         Depends on|                            |7988


--- Comment #2 from Don <clugdbug@yahoo.com.au> 2012-09-26 00:45:55 PDT ---
Before CTFE begins, the code in comment 1 is translated into:

F().f((G __tmpsl5 = G(); , __tmpsl5))

The problem is that the comma expression is evaluated outside of CTFE. This would be fixed by bug 7988.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 07, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8255


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2013-10-06 23:21:23 PDT ---
I get the following message from 2.064 head:

test.d(3): Error: function test.F!(G).F.f (ref G _param_0) is not callable
using argument types (G)
test.d(3):        while evaluating pragma(msg, F().f(G()))

No ice.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------