aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorSahnvour <sahnvour@pm.me>2019-09-03 22:29:04 +0200
committerAndrew Kelley <andrew@ziglang.org>2019-09-03 21:14:40 -0400
commitce14c543d165efbd926ea6bd654d999c625b366f (patch)
tree8d4f08b3ff22dee7a98fd09b157f008ba114c035 /src/analyze.cpp
parenta4ce10df8087e7051340e14e4acd018092f935f0 (diff)
downloadzig-ce14c543d165efbd926ea6bd654d999c625b366f.tar.gz
zig-ce14c543d165efbd926ea6bd654d999c625b366f.zip
error message and test for alignment of variables of zero-bit types
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp4
1 files changed, 4 insertions, 0 deletions
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) {