The DMD source view looks like this: alignofdoes not consider attributes align.
Here it is processed:
... if (ident == Id::__xalignof)
{
e = new IntegerExp(loc, alignsize(), Type::tsize_t);
}
This converts the expression .alignofinto an expression size_twith a value alignsize(), so consider alignsize()for a static array:
unsigned TypeSArray::alignsize()
{
return next->alignsize();
}
It just gets element type alignment ( void) in your case.
voidprocessed TypeBasic::alignsize()which just goes intoTypeBasic::size(0)
switch (ty)
{
...
case Tvoid:
size = 1;
break;
...
}
, alignof, , align , . , .