Skip to content

Commit

Permalink
Added types found in cast to Environment.
Browse files Browse the repository at this point in the history
New types introduced in casts are now inserted into the right
Environment and carried along.
Bug 19614.
  • Loading branch information
bschommer committed Aug 23, 2016
1 parent fbac335 commit e829671
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cparser/Elab.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@ let elab_expr vararg loc env a =
(* 6.5.4 Cast operators *)

| CAST ((spec, dcl), SINGLE_INIT a1) ->
let (ty, _) = elab_type loc env spec dcl in
let (ty, env) = elab_type loc env spec dcl in
let b1,env = elab env a1 in
if not (wrap2 valid_cast loc env b1.etyp ty) then
err "illegal cast from %a@ to %a" Cprint.typ b1.etyp Cprint.typ ty;
Expand All @@ -1484,7 +1484,7 @@ let elab_expr vararg loc env a =
(* 6.5.2.5 Compound literals *)

| CAST ((spec, dcl), ie) ->
let (ty, _) = elab_type loc env spec dcl in
let (ty, env) = elab_type loc env spec dcl in
begin match elab_initializer loc env "<compound literal>" ty ie with
| (ty', Some i) -> { edesc = ECompound(ty', i); etyp = ty' },env
| (ty', None) -> error "ill-formed compound literal"
Expand Down

0 comments on commit e829671

Please sign in to comment.