Bug 368 – "immediate"-function types allowed as the return type of functions.
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-09-26T07:00:00Z
Last change time
2014-02-15T13:19:33Z
Keywords
accepts-invalid, ice-on-invalid-code
Assigned to
bugzilla
Creator
bruno.do.medeiros+deebugz
Comments
Comment #0 by bruno.do.medeiros+deebugz — 2006-09-26T07:00:45Z
"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("");
}
----
Comment #1 by bugzilla — 2006-10-04T19:58:36Z
Fixed DMD 0.168
Comment #2 by thomas-dloop — 2006-10-06T02:10:35Z
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[email protected] 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.dhttp://dstress.kuehne.cn/nocompile/t/typeof_12_B.d
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFFJf/XLK5blCcjpWoRAqSbAJ9gzkKXk4I/n1rJ5ff7IVljm+2uyQCbB/d+
cdjrT9FpgLLGafR4lAKLEVM=
=H3+j
-----END PGP SIGNATURE-----