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





------- Comment #1 from shro8822 vandals.uidaho.edu  2007-10-18 17:59 -------
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                    |




------- Comment #2 from s.d.hammett googlemail.com  2007-10-18 18:04 -------
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




------- Comment #3 from thomas-dloop kuehne.cn  2007-10-19 12:22 -------
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




------- Comment #4 from bugzilla digitalmars.com  2007-11-03 21:50 -------
Fixed dmd 1.023 and 2.007


-- 
Nov 03 2007