Is there a good reason why align() applied to structure definitions is not allowed on the struct definition line within unit-test code blocks?
E.g.: unittest { align(1) struct Foo { char c; int i; } void Bar() { Foo f; } } int main() { return 0; } fails to compile. The error message is: found 'align' instead of statement The error message is the same for both DMD and GDC. If you take the align(1) out it compiles OK. If you move the structure definition out of the unit-test block but leave the align(1) in place it compiles OK. If you put the align(1) on each member variable definition instead of the struct line it compiles OK. If the structure type is only used within the unit-test code then I would think it ought to be possible to define it (including it's alignment attribute) within that unit-test code block.