On Monday, 5 December 2016 at 07:55:32 UTC, deadalnix wrote:
On Monday, 5 December 2016 at 04:26:35 UTC, Stefan Koch wrote:
I just improved the handling of void initializations.
Now the code is less pessimistic and will allow them if they are assigned to before use. However using void variables at ctfe will not result in any performance wins.

Void initialization are allowed at CTFE ?

the following code will compile just fine.
uint fn(uint a) {
 int b = void;
 if (a == 2)
 {
   b = 1;
 }

 return b; // only fine is a was 2;
}

static assert(fn(2) == 1);

Reply via email to