aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrea Orru <andrea@orru.io>2018-03-13 22:07:40 -0700
committerAndrea Orru <andrea@orru.io>2018-03-13 22:07:40 -0700
commitc828c23f71055fc4614ada20a20fb1c7bfee50c6 (patch)
tree2c601b10869b3ea4ee287a44ae5bf37b08445569 /src/ir.cpp
parent7ac44037db686b93de25b6d826f596985d79ea42 (diff)
downloadzig-c828c23f71055fc4614ada20a20fb1c7bfee50c6.tar.gz
zig-c828c23f71055fc4614ada20a20fb1c7bfee50c6.zip
Tests for zero-bit field compiler error
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 797e58f991..51a538db59 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -15223,10 +15223,10 @@ static TypeTableEntry *ir_analyze_instruction_offset_of(IrAnalyze *ira,
}
if (field->type_entry->zero_bits) {
- ir_add_error(ira, field_name_value,
- buf_sprintf("zero-bit field '%s' in struct '%s' has no offset",
- buf_ptr(field_name), buf_ptr(&container_type->name)));
- return ira->codegen->builtin_types.entry_invalid;
+ ir_add_error(ira, field_name_value,
+ buf_sprintf("zero-bit field '%s' in struct '%s' has no offset",
+ buf_ptr(field_name), buf_ptr(&container_type->name)));
+ return ira->codegen->builtin_types.entry_invalid;
}
size_t byte_offset = LLVMOffsetOfElement(ira->codegen->target_data_ref, container_type->type_ref, field->gen_index);
ConstExprValue *out_val = ir_build_const_from(ira, &instruction->base);