www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8255] New: ICE when passing 'ref' literal

reply d-bugmail puremagic.com writes:
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



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: -------
Jun 16 2012
next sibling parent d-bugmail puremagic.com writes:
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



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: -------
Jun 17 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
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



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: -------
Sep 26 2012
prev sibling parent d-bugmail puremagic.com writes:
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



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: -------
Oct 06 2013