From 640babdc9ea0958de967ce8b5ac84bb0309b3835 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 25 Aug 2016 13:48:05 +0200 Subject: Test if struct is redefined as union or otherwise. If a declaration of a composite is encountered it is also tested if the kind is equal. Bug 19630. --- cparser/Elab.ml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cparser/Elab.ml') diff --git a/cparser/Elab.ml b/cparser/Elab.ml index f8d2cb77..6c039d9b 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -838,6 +838,8 @@ and elab_struct_or_union only kind loc tag optmembers attrs env = and the composite was bound in another scope, create a new incomplete composite instead via the case "_, None" below. *) + if ci.ci_kind <> kind then + fatal_error loc "struct/union mismatch on tag '%s'" tag; warn_attrs(); (tag', env) | Some(tag', ({ci_sizeof = None} as ci)), Some members -- cgit