D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6778 - Internal error on parsing functions with arguments on which opOpAssign is invoked
Summary: Internal error on parsing functions with arguments on which opOpAssign is inv...
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P2 critical
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-07 04:44 UTC by Armin Kazmi
Modified: 2012-04-28 01:56 UTC (History)
1 user (show)

See Also:


Attachments
Test sample file (370 bytes, application/octet-stream)
2011-10-07 04:44 UTC, Armin Kazmi
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Armin Kazmi 2011-10-07 04:44:17 UTC
The following code sample fails in all cases:

import std.stdio;                                                                                                                                                                                                    
void main()                                                                                                                                                                                                          
{                                                                                                                                                                                                                    
    class test                                                                                                                                                                                                       
    {                                                                                                                                                                                                                
        this(double t)
        {

        }
    };

    struct testStruct
    {
        this(double t)
        {
        }
    };

    double b = 2;
    double c = 4;

    void funcTest(double t)
    {
    }

    //testStruct( b /= c ); // <-- Internal error: backend/cg87.c 202 when pulled in
    //new test( b /= c ); // <-- Internal error: backend/cg87.c 202 when pulled in
    funcTest(b *= c);   // <-- Internal error: backend/cg87.c 202

    writefln("b = %1$s", b);
}
Comment 1 Armin Kazmi 2011-10-07 04:44:43 UTC
Created attachment 1036 [details]
Test sample file
Comment 2 Walter Bright 2012-04-28 01:56:59 UTC
This works without error on dmd 2.060 latest, on Linux with -m32 and -m64.