diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-08-25 20:52:35 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-08-29 22:14:10 -0700 |
| commit | 6e6d138c2f50f95fe9c6b4acbc16ffa17475a4a5 (patch) | |
| tree | f89b50b2a9f57c9149b555240e2e9a2fc760c6b8 /src/codegen.cpp | |
| parent | 651dc31247c2f637925ed6a6e92c8bc1a19efd5c (diff) | |
| download | zig-6e6d138c2f50f95fe9c6b4acbc16ffa17475a4a5.tar.gz zig-6e6d138c2f50f95fe9c6b4acbc16ffa17475a4a5.zip | |
add ability to explicitly cast enum with no payload to int
Diffstat (limited to 'src/codegen.cpp')
| -rw-r--r-- | src/codegen.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/codegen.cpp b/src/codegen.cpp index 82f7084159..bf13ba3036 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -1062,6 +1062,8 @@ static LLVMValueRef gen_cast_expr(CodeGen *g, AstNode *node) { case CastOpIntToEnum: return gen_widen_or_shorten(g, node, actual_type, wanted_type->data.enumeration.tag_type, expr_val); + case CastOpEnumToInt: + return gen_widen_or_shorten(g, node, actual_type->data.enumeration.tag_type, wanted_type, expr_val); } zig_unreachable(); } |
