[MS ABI] Don't crash when inheriting from base with trailing empty array member
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 22 Oct 2015 18:04:22 +0000 (18:04 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 22 Oct 2015 18:04:22 +0000 (18:04 +0000)
commit78945d0721ea631bfb4535ea36058567a07a6991
tree17702966bce6b6af1701d8300be1dafe131cacc0
parent227d71bba6de6b39f6e7bbc22288e966858a030d
[MS ABI] Don't crash when inheriting from base with trailing empty array member

We got this right for Itanium but not MSVC because CGRecordLayoutBuilder
was checking if the base's size was zero when it should have been
checking the non-virtual size.

This fixes PR21040.

llvm-svn: 251036
clang/lib/CodeGen/CGRecordLayoutBuilder.cpp
clang/test/Layout/ms-x86-empty-nonvirtual-bases.cpp