DIP 1029---Add throw as Function Attribute---Community Review Round 1

Timon Gehr timon.gehr at gmx.ch
Thu Jan 16 08:35:47 UTC 2020


On 16.01.20 09:04, Walter Bright wrote:
> 
> For functions, the line is:
> 
>    sc2.stc &= ~(STC.auto_ | STC.scope_ | STC.static_ | STC.extern_ | 
> STC.abstract_ | STC.deprecated_ | STC.override_ |
>                 STC.TYPECTOR | STC.final_ | STC.tls | STC.gshared | 
> STC.ref_ | STC.return_ | STC.property |
>                 STC.nothrow_ | STC.pure_ | STC.safe | STC.trusted | 
> STC.system);
> 
> https://github.com/dlang/dmd/blob/master/src/dmd/semantic3.d#L316
> 
> Interestingly, @nogc does flow through here.

This is just plain broken and cannot be explained as anything but as an 
oversight. It's the root cause of this issue:
https://issues.dlang.org/show_bug.cgi?id=18439

Why should nogc functions not be able to use the GC within lambdas that 
are executed exclusively during CTFE?


More information about the Digitalmars-d mailing list