[Issue 270] New: Compiler allows and crashes on typedefs of "immediate"-function types

Thomas Kuehne thomas-dloop at kuehne.cn
Tue Aug 15 05:21:24 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail at puremagic.com schrieb am 2006-07-29:
> http://d.puremagic.com/issues/show_bug.cgi?id=270

> Compiler allows and crashes on typedefs of "immediate"-function types,
> where "immediate-function" types are non-pointer function types.
> Code example:
>
>   typedef int ft(int);
>   //typedef typeof(test) fp; // This alternative typedef also crashes
>
>   void test()
>   {
>     ft[10] a;
>   }
>
> ---
> This raises the issue: should a typedef of an "immediate" function type even be
> allowed? Seems to me not, as one can't use the typedef for any declaration!
>
> ((
> While we're at it, should storage attributes be allowed in a typedef? Like:
> "typedef static const final override auto int sometype;" ?
> It also seems to me not.
> ))
>
> Whichever the case (even without changes), the spec grammar should also be
> corrected. An example of a current doc error is:
>
>         typedef Decl
>   Decl:
>         ...
>         BasicType Declarator FunctionBody
>
> but the compiler does not accept typedefs with function bodies.

Added to DStress as
http://dstress.kuehne.cn/nocompile/a/alias_37_A.d
http://dstress.kuehne.cn/nocompile/a/alias_37_B.d
http://dstress.kuehne.cn/nocompile/a/alias_37_C.d
http://dstress.kuehne.cn/nocompile/a/alias_37_D.d
http://dstress.kuehne.cn/nocompile/t/typedef_17_A.d
http://dstress.kuehne.cn/nocompile/t/typedef_17_B.d
http://dstress.kuehne.cn/nocompile/t/typedef_17_C.d
http://dstress.kuehne.cn/nocompile/t/typedef_17_D.d

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFE4bgSLK5blCcjpWoRAp3+AJsFKx96ZcXQhdRZ63edKQwKRUnE6QCfby6k
mowRlio1tzWR9pZl65Gp+FA=
=G6XF
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-bugs mailing list