diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2019-11-30 23:43:02 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2019-11-30 23:43:58 -0500 |
commit | 0f26f41c326f4dab86cdd1791e08d03d624eeb99 (patch) | |
tree | a99eeb864d1b17f41abdc213504d0aea0cc9518b /types.c | |
parent | d984e1585b749f184d2014ffff498ce5f36bcf5a (diff) |
trying to make this compilable with a c++ compiler
maybe it works on some but gccs not happy with my gotos...
Diffstat (limited to 'types.c')
-rw-r--r-- | types.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -198,7 +198,7 @@ static bool type_of_fn(Typer *tr, FnExpr *f, Location where, Type *t, U16 flags) FnExpr fn_copy; if (!(flags & TYPE_OF_FN_NO_COPY_EVEN_IF_CONST) && fn_has_any_const_params(f)) { - Copier cop = {.allocr = tr->allocr, .block = tr->block}; + Copier cop = copier_create(tr->allocr, tr->block); copy_fn_expr(&cop, &fn_copy, f, false); f = &fn_copy; } @@ -1105,7 +1105,7 @@ static bool types_expr(Typer *tr, Expression *e) { /* TODO: evaluate once per decl, not once per ident */ Expression copy; /* make a copy of the default argument, and type and evaluate it. */ - Copier cop = {.block = tr->block, .allocr = tr->allocr}; + Copier cop = copier_create(tr->allocr, tr->block); copy_expr(&cop, ©, ¶m->expr); if (!types_expr(tr, ©)) return false; @@ -1146,7 +1146,7 @@ static bool types_expr(Typer *tr, Expression *e) { /* fn is the instance, original_fn is not */ FnExpr *original_fn = fn; FnExpr fn_copy; - Copier cop = {.allocr = tr->allocr, .block = tr->block}; + Copier cop = copier_create(tr->allocr, tr->block); /* TODO: somehow don't do all of this if we've already generated this instance */ copy_fn_expr(&cop, &fn_copy, fn, true); fn = &fn_copy; |