From 2084c5b91929b9290b7e02979ee038bb98d1053e Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Mon, 22 Aug 2016 13:01:50 +0200 Subject: Test for incomplete type during initialization. Before the initializazion is computed we check wether the type is incomplete. Bug 19601 --- cparser/Elab.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cparser') diff --git a/cparser/Elab.ml b/cparser/Elab.ml index b2426738..99370df6 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -1287,7 +1287,12 @@ and elab_single zi a il = (* Start with top-level object initialized to default *) -in elab_item (I.top env root ty_root) ie [] +in +if wrap incomplete_type loc env ty_root then begin + 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 *) -- cgit