www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 368] New: "immediate"-function types allowed as the return type of functions.

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

           Summary: "immediate"-function types allowed as the return type of
                    functions.
           Product: D
           Version: 0.167
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid, ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: brunodomedeiros+bugz gmail.com


"immediate"-function types allowed as the return type of functions. Example:

--------
void func(int a) { }
//typedef int ft(int);

typeof(func) test() {
}
----
Instead, the compiler complains that a return is needed (yet such return value
can not be specified). Using a typedef results in the same problem.

The following extended testcase crashes the compiler:

--------
void func(int a) { }

typeof(func) test() {
    if(true) throw new Exception("");
}
----


-- 
Sep 26 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=368


bugzilla digitalmars.com changed:

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





Fixed DMD 0.168


-- 
Oct 04 2006
prev sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail puremagic.com schrieb am 2006-09-26:
 http://d.puremagic.com/issues/show_bug.cgi?id=368
 "immediate"-function types allowed as the return type of functions. Example:

 --------
 void func(int a) { }
 //typedef int ft(int);

 typeof(func) test() {
 }
 ----
 Instead, the compiler complains that a return is needed (yet such return value
 can not be specified). Using a typedef results in the same problem.

 The following extended testcase crashes the compiler:

 --------
 void func(int a) { }

 typeof(func) test() {
     if(true) throw new Exception("");
 }
 ----
Added to DStress as http://dstress.kuehne.cn/nocompile/t/typeof_12_A.d http://dstress.kuehne.cn/nocompile/t/typeof_12_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFJf/XLK5blCcjpWoRAqSbAJ9gzkKXk4I/n1rJ5ff7IVljm+2uyQCbB/d+ cdjrT9FpgLLGafR4lAKLEVM= =H3+j -----END PGP SIGNATURE-----
Oct 06 2006