www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1593] New: ICE compiler crash empty return statement in template function

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

           Summary: ICE compiler crash empty return statement in template
                    function
           Product: D
           Version: 1.015
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: minor
          Priority: P3
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: s.d.hammett googlemail.com


Following code cause dmd to crash.

struct A {
}

A MakeA() {
        return ;
}

static const A aInstance = MakeA();

with dmd versions 1.015 & 1.021


-- 
Oct 18 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1593






Is that the correct code? It's not a template.

(If DMD chokes it's still a bug)

Does the CTFE make a difference?


-- 
Oct 18 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1593


s.d.hammett googlemail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|ICE compiler crash empty    |ICE compiler crash empty
                   |return statement in template|return statement in function
                   |function                    |





yes the code is (in)correct.
I thought it was a template bug to start with, but I pared it down to above.
I missed the fact it's no longer a template... never submit a bug report after
a beer.


-- 
Oct 18 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1593


thomas-dloop kuehne.cn changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         OS/Version|Windows                     |All





Added to DStress as
http://dstress.kuehne.cn/nocompile/r/return_11_A.d
http://dstress.kuehne.cn/nocompile/r/return_11_B.d
http://dstress.kuehne.cn/nocompile/r/return_11_C.d
http://dstress.kuehne.cn/nocompile/r/return_11_D.d
http://dstress.kuehne.cn/nocompile/r/return_11_E.d
http://dstress.kuehne.cn/nocompile/r/return_11_F.d
http://dstress.kuehne.cn/nocompile/r/return_11_G.d


-- 
Oct 19 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1593


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed dmd 1.023 and 2.007


-- 
Nov 03 2007