Opened 2 months ago

#270 new defect

No NoCtor

Reported by: pabuhr Owned by:
Priority: minor Component: cfa-cc
Version: 1.0 Keywords:


While attempting to create a CFA NoCtor?, I hit a show-stopper bug. Something is generating bad C code that fails. Note, the use of sizeof(T) in a generic type, which may not have been tested before.
forall( T & | sized(T) )

struct NoCtor? {

char storage[sizeof(T)];


forall( T )

void ctor( NoCtor?(T) & t ) { (*(T *){}; } In function '_X4ctorQ1_0_0_4X16_operator_assignFBD0_BD0BD0X12_constructorFv_BD0X12_constructorFv_BD0BD0X11_destructorFv_BD0Fv_S6NoCtor_BD0_1': error: '_sizeof_Y12T_generic_' undeclared (first use in this function)

5 | char storage[sizeof(T)];

| ~ note: each undeclared identifier is reported only once for each function it appears in

Change History (0)

Note: See TracTickets for help on using tickets.