]> granicus.if.org Git - clang/commit
Sema: Diagnose undefined structs used as Microsoft anonymous structs
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 18 Sep 2014 00:42:05 +0000 (00:42 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 18 Sep 2014 00:42:05 +0000 (00:42 +0000)
commit89b53e0a49c30942d4ef77218a6155e0699a3f00
tree93dd47ea6042b43cc325cb9a55776760705dba5a
parentd6cc5ac4d693b9c3523ed86ec8d430a163f7986f
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.)

This fixes PR11847.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218006 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDecl.cpp
test/Sema/MicrosoftExtensions.c