From 15fc340f69e9c4d718c15fd9ec12a81695cf8d67 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 2 Feb 2016 08:48:42 +0100 Subject: Make void always incomplete and exit on void members. Since we cannot construct a default initializer for void types we need to exit earlier. Bug 18004. --- cparser/Cutil.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cparser/Cutil.ml') diff --git a/cparser/Cutil.ml b/cparser/Cutil.ml index 94e3e85d..c82ada26 100644 --- a/cparser/Cutil.ml +++ b/cparser/Cutil.ml @@ -552,7 +552,12 @@ let struct_layout env members = (* Determine whether a type is incomplete *) let incomplete_type env t = - match sizeof env t with None -> true | Some _ -> false + match unroll env t with + | TVoid _ -> true (* Void is always incomplete *) + | _ -> begin match sizeof env t with + | None -> true + | Some _ -> false + end (* Computing composite_info records *) -- cgit