diff options
| author | Josh Wolfe <thejoshwolfe@gmail.com> | 2017-04-23 16:59:55 -0700 |
|---|---|---|
| committer | Josh Wolfe <thejoshwolfe@gmail.com> | 2017-04-23 21:15:15 -0700 |
| commit | c6605cba8375871a145896f9cf1090e9c823214a (patch) | |
| tree | f6309057804dc9fd6d5fa10feafb9d8f6a44a713 /src/codegen.cpp | |
| parent | 6de33ded81981554ccffc3ecbfcd5b0f628cf502 (diff) | |
| download | zig-c6605cba8375871a145896f9cf1090e9c823214a.tar.gz zig-c6605cba8375871a145896f9cf1090e9c823214a.zip | |
blocks check that their statements are void
closes #291
This changes the error message "return value ignored" to "expression value is ignored".
This is because this error also applies to {1;}, which has no function calls.
Also fix ignored expression values in std and test.
This caught a bug in debug.readAllocBytes where an early Eof error would have been missed.
See #219.
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index c89e9ad7e6..5e31abc62e 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2885,6 +2885,7 @@ static LLVMValueRef ir_render_instruction(CodeGen *g, IrExecutable *executable, case IrInstructionIdTestComptime: case IrInstructionIdGeneratedCode: case IrInstructionIdCheckSwitchProngs: + case IrInstructionIdCheckStatementIsVoid: case IrInstructionIdTestType: case IrInstructionIdTypeName: case IrInstructionIdCanImplicitCast: |
