www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6173] New: Compiler treats read access of a delegate's function pointer as an lvalue access

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6173

           Summary: Compiler treats read access of a delegate's function
                    pointer as an lvalue access
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: schveiguy yahoo.com



18:39:40 PDT ---
The following code:

struct S
{
   void foo();
}

void main()
{
   S s;
   auto fptr = (&s.foo).funcptr;
}

Generates the following error:

testdelegatefuncptr.d(9): Error: &s.foo is not an lvalue

But clearly, I'm not using &s.foo as an lvalue.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 17 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6173


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |DUPLICATE



This is because dg.funcptr is re-written as *(&dg+4), it's on my list.

*** This issue has been marked as a duplicate of issue 2472 ***

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