r218006 - Sema: Diagnose undefined structs used as Microsoft anonymous structs

jahanian fjahanian at apple.com
Thu Sep 18 09:33:52 PDT 2014


On Sep 17, 2014, at 5:42 PM, David Majnemer <david.majnemer at gmail.com> wrote:

> Author: majnemer
> Date: Wed Sep 17 19:42:05 2014
> New Revision: 218006
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=218006&view=rev
> Log:
> Sema: Diagnose undefined structs used as Microsoft anonymous structs
> 
> Previously, we would not mark structs containing anonymous structs as
> invalid.  Later, horrific things would occur when trying to determine
> the size of the parent record.
> 
> Instead, require the struct to be a complete type when used as an
> anonymous struct.  Mark both the anonymous field for the struct and the
> parent context as invalid (this is similar to what we do when a struct
> contains a field with an incomplete type.)


Thank you David for working on this. Will this test case continue to work without error. This was the behavior before:

struct anon_fault {
	struct undefined;
};

struct undefined {
  int ii;
};

int main()
{
  return sizeof(struct anon_fault);
}

- Fariborz

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140918/d4741e4e/attachment.html>


More information about the cfe-commits mailing list