aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Elab.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2016-08-23 10:50:48 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2016-08-23 10:50:48 +0200
commitc3c0aba2ed285bc33208cfc67667f47d6d1b0762 (patch)
tree666ace2761c58fde7fabd3668dda1d29540def5e /cparser/Elab.ml
parente829671ab99a98dca212c6f29d29b952dbc1fa80 (diff)
downloadcompcert-c3c0aba2ed285bc33208cfc67667f47d6d1b0762.tar.gz
compcert-c3c0aba2ed285bc33208cfc67667f47d6d1b0762.zip
Fix for initialization of incomplete types
Since some incomplete types are allowed in initialization just test whether the default initilization exists. Bug 19601
Diffstat (limited to 'cparser/Elab.ml')
-rw-r--r--cparser/Elab.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml
index 16e2b298..f8d2cb77 100644
--- a/cparser/Elab.ml
+++ b/cparser/Elab.ml
@@ -1292,11 +1292,11 @@ if is_function_type env ty_root then begin
error loc "illegal initializer (only variables can be initialized)";
raise Exit
end;
-if wrap incomplete_type loc env ty_root then begin
+try
+ elab_item (I.top env root ty_root) ie []
+with No_default_init ->
error loc "variable has incomplete type %a" Cprint.typ ty_root;
raise Exit
-end;
-elab_item (I.top env root ty_root) ie []
(* Elaboration of a top-level initializer *)