From e224022a4887029ed099a265a8e3c71c84d67556 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Wed, 2 May 2018 10:04:52 +0200 Subject: Reject arrays of incomplete type (#90) The type of array elements must be complete. Bug 23341 --- cparser/Elab.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cparser/Elab.ml b/cparser/Elab.ml index beb3e3cf..1b87c095 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -685,6 +685,8 @@ and elab_type_declarator keep_ty loc env ty kr_ok = function | Cabs.ARRAY(d, cv_specs, sz) -> let (ty, a) = get_nontype_attrs env ty in let a = add_attributes a (elab_cvspecs env cv_specs) in + if wrap incomplete_type loc env ty then + error loc "array type has incomplete element type %a" (print_typ env) ty; let sz' = match sz with | None -> -- cgit