diff options
author | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-09-27 13:18:17 +0200 |
---|---|---|
committer | Bernhard Schommer <bernhardschommer@gmail.com> | 2016-09-27 13:18:17 +0200 |
commit | ad2a2c862abef3aee701d1bca0524fcbf2d07b30 (patch) | |
tree | b14de9bd5716b583bcbe5ad1746a7ad53fddf866 /cparser/Elab.ml | |
parent | 0218da79e51bfdd3b5911aa0b80febf4cb7c0ef4 (diff) | |
download | compcert-ad2a2c862abef3aee701d1bca0524fcbf2d07b30.tar.gz compcert-ad2a2c862abef3aee701d1bca0524fcbf2d07b30.zip |
Keep anonymous members of anonymous structs.
The anonymous members are kept but using them is still an error.
Bug 19907
Diffstat (limited to 'cparser/Elab.ml')
-rw-r--r-- | cparser/Elab.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml index 713ea04e..38ef7617 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -827,8 +827,10 @@ and elab_struct_or_union_info keep_ty kind loc env members attrs = if List.exists ((=) n) acc then error loc "duplicate member '%s'" n; n::acc - end else - acc) [] m); + end else begin + if Cutil.is_composite_type env fld.fld_typ then + warning loc Celeven_extension "anonymous structs/unions are a C11 extension"; + acc end) [] m); (* Check for incomplete types *) let rec check_incomplete = function | [] -> () |