From ce14c543d165efbd926ea6bd654d999c625b366f Mon Sep 17 00:00:00 2001 From: Sahnvour Date: Tue, 3 Sep 2019 22:29:04 +0200 Subject: error message and test for alignment of variables of zero-bit types --- src/analyze.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/analyze.cpp') diff --git a/src/analyze.cpp b/src/analyze.cpp index 188da18515..2fd540a64f 100644 --- a/src/analyze.cpp +++ b/src/analyze.cpp @@ -2671,6 +2671,10 @@ static Error resolve_struct_alignment(CodeGen *g, ZigType *struct_type) { } } + if (!type_has_bits(struct_type)) { + assert(struct_type->abi_align == 0); + } + struct_type->data.structure.resolve_loop_flag_other = false; if (struct_type->data.structure.resolve_status == ResolveStatusInvalid) { -- cgit v1.2.3