From f26267c6289e4fa306a0875ff149a00ee401e043 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 18 Aug 2016 09:46:23 +0200 Subject: Disallow void as type for variables. This allows problems in elaboration of the initializers for variables of void type. Bug 19577. --- cparser/Elab.ml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cparser/Elab.ml b/cparser/Elab.ml index 8cd7ed64..2b5b4591 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -1942,6 +1942,8 @@ let enter_decdefs local loc env sto dl = initializer can refer to the ident *) let (id, sto', env1, ty, linkage) = enter_or_refine_ident local loc env s sto1 ty in + if not isfun && is_void_type env ty then + fatal_error loc "'%s' has incomplete type" s; (* process the initializer *) let (ty', init') = elab_initializer loc env1 s ty init in (* update environment with refined type *) -- cgit