From e829671ab99a98dca212c6f29d29b952dbc1fa80 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 23 Aug 2016 09:04:04 +0200 Subject: Added types found in cast to Environment. New types introduced in casts are now inserted into the right Environment and carried along. Bug 19614. --- cparser/Elab.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cparser') diff --git a/cparser/Elab.ml b/cparser/Elab.ml index 76a7379c..16e2b298 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -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; @@ -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 "" ty ie with | (ty', Some i) -> { edesc = ECompound(ty', i); etyp = ty' },env | (ty', None) -> error "ill-formed compound literal" -- cgit