diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-08-23 10:50:48 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-08-23 10:50:48 +0200 |
commit | c3c0aba2ed285bc33208cfc67667f47d6d1b0762 (patch) | |
tree | 666ace2761c58fde7fabd3668dda1d29540def5e /cparser/Elab.ml | |
parent | e829671ab99a98dca212c6f29d29b952dbc1fa80 (diff) | |
download | compcert-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.ml | 6 |
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 *) |