aboutsummaryrefslogtreecommitdiff
path: root/src-self-hosted
diff options
context:
space:
mode:
authorhryx <codroid@gmail.com>2019-06-27 23:12:33 -0700
committerhryx <codroid@gmail.com>2019-06-27 23:12:33 -0700
commitcc74bf51366c71ba997eb3015f2b687a3a18fd57 (patch)
treeaf4ed087ca99a3fee39ea959fc8411c2476ac458 /src-self-hosted
parent646268875e04250609d7e355af1618077c4a290f (diff)
downloadzig-cc74bf51366c71ba997eb3015f2b687a3a18fd57.tar.gz
zig-cc74bf51366c71ba997eb3015f2b687a3a18fd57.zip
Translate IntegralCast; add stage2 test coverage
Diffstat (limited to 'src-self-hosted')
-rw-r--r--src-self-hosted/translate_c.zig9
1 files changed, 9 insertions, 0 deletions
diff --git a/src-self-hosted/translate_c.zig b/src-self-hosted/translate_c.zig
index efab428454..d6b72f3dd8 100644
--- a/src-self-hosted/translate_c.zig
+++ b/src-self-hosted/translate_c.zig
@@ -615,6 +615,15 @@ fn transImplicitCastExpr(
.child_scope = scope,
};
},
+ .IntegralCast => {
+ const dest_type = ZigClangExpr_getType(@ptrCast(*const ZigClangExpr, expr));
+ const src_type = ZigClangExpr_getType(sub_expr);
+ return TransResult{
+ .node = try transCCast(rp, scope, ZigClangImplicitCastExpr_getBeginLoc(expr), dest_type, src_type, sub_expr_node.node),
+ .node_scope = scope,
+ .child_scope = scope,
+ };
+ },
.FunctionToPointerDecay, .ArrayToPointerDecay => {
return maybeSuppressResult(rp, scope, result_used, sub_expr_node);
},