www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3691] New: compiler 1.055 crashes with some invalid code in is(typeof())

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

           Summary: compiler 1.055 crashes with some invalid code in
                    is(typeof())
           Product: D
           Version: 1.054
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: fawzi gmx.ch


--- Comment #0 from Fawzi Mohamed <fawzi gmx.ch> 2010-01-08 08:23:36 PST ---
{{{
template RefType(T) {
    static if (is(T == class)) {
        alias T RefType;
    } else {
        alias T* RefType;
    }
}


template UnrefType(T) {
    static if (is(T == class)) {
        alias T UnrefType;
    } else {
        alias typeof(*T) UnrefType;
    }
}

struct P{
    int i;
}


void f(T)(){
    static if(is(typeof(function RefType!(P)(){ return new UnrefType!(P); }))){
        pragma(msg,"pippo");
    }
}

void g(){
    f!(P)();
}
}}}

crashes the compiler (1.055) it seems that unreferencing the structure (which
cannot be done) really upsets the compiler.
This used to work, and basically anything syntactically parseable should be
accepted in is(typeof()) without crashing the compiler (it should just return
false).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 08 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3691


Matti Niemenmaa <matti.niemenmaa+dbugzilla iki.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |matti.niemenmaa+dbugzilla i
                   |                            |ki.fi
         Resolution|                            |DUPLICATE


--- Comment #1 from Matti Niemenmaa <matti.niemenmaa+dbugzilla iki.fi>
2010-01-08 08:27:28 PST ---
*** This issue has been marked as a duplicate of issue 3685 ***

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