diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-02-24 15:00:47 -0500 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-02-24 15:01:19 -0500 |
| commit | a665872e881920e8020a513340d2427b88a55bd6 (patch) | |
| tree | ff81a6b509584d737d0df15d293dc01ae1390469 /src/codegen.cpp | |
| parent | 3b40aaa01fb15799cf27d662229597ac98e2ab77 (diff) | |
| download | zig-a665872e881920e8020a513340d2427b88a55bd6.tar.gz zig-a665872e881920e8020a513340d2427b88a55bd6.zip | |
add compile error for ignoring return value
also introduce the _ identifier which you can assign to
to discard a return value
closes #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 8fec6a4c51..99e095ffbc 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -2928,6 +2928,7 @@ static LLVMValueRef gen_const_val(CodeGen *g, ConstExprValue *const_val) { render_const_val_global(g, const_val, ""); switch (const_val->data.x_ptr.special) { case ConstPtrSpecialInvalid: + case ConstPtrSpecialDiscard: zig_unreachable(); case ConstPtrSpecialRef: { |
