From a350ca30d76323cd8c9957b3d70e2ee3f7562d1f Mon Sep 17 00:00:00 2001 From: xleroy Date: Wed, 20 Aug 2014 12:51:22 +0000 Subject: Improve error reporting for unsupported compound literals. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2608 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- cparser/Elab.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cparser/Elab.ml b/cparser/Elab.ml index 15b749d..a352e5f 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -933,7 +933,10 @@ let elab_expr loc env a = { edesc = ECast(ty, b1); etyp = ty } | CAST ((spec, dcl), _) -> - error "cast of initializer expression is not supported" + err "compound literals are not supported"; + (* continue with dummy expression of the correct type *) + let ty = elab_type loc env spec dcl in + { edesc = ECast(ty, nullconst); etyp = ty } | EXPR_SIZEOF a1 -> let b1 = elab a1 in -- cgit v1.2.3