summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-08-20 12:51:22 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2014-08-20 12:51:22 +0000
commita350ca30d76323cd8c9957b3d70e2ee3f7562d1f (patch)
treec552de500ca5785643d386ef61a13555f1819159
parent6875a7c5fe477d7cc9686ad38b8856edb2d911ad (diff)
Improve error reporting for unsupported compound literals.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2608 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
-rw-r--r--cparser/Elab.ml5
1 files changed, 4 insertions, 1 deletions
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