newCTFE Status June 2020

Stefan Koch uplink.coder at googlemail.com
Mon Jun 8 21:07:06 UTC 2020


On Monday, 8 June 2020 at 15:43:02 UTC, kinke wrote:
> On Monday, 8 June 2020 at 15:30:26 UTC, Stefan Koch wrote:
>> This is because dmd is a little funky and does not generate a 
>> default construction-function for you.
>> Rather it leaves you to build your own.
>> (As far as I can see anyways.)
>>
>> Which I then documented on a new wiki page were all of my more 
>> surprising discoveries about dmd will land.
>>
>> [from the Wiki page]
>>
>> Will be represented as a `NewExp`
>> To get the function that is being called you need to look at 
>> the member `member` If that `FuncDeclaration` is null, this is 
>> a call to the default constructor.
>
> Allocation and pre-initialization of classes is handled by 
> _d_newclass in druntime. If NewExp.member is null, it means 
> that the class has no default ctor, so no ctor call is needed.

Ah so bringing a class to the initial state, is done by 
_d_newclass.
Yet another runtime function which CTFE has to re-implement.




More information about the Digitalmars-d mailing list