[Clang][MS] Remove assertion on BaseOffset can't be smaller than Size.
authorZequan Wu <zequanwu@google.com>
Thu, 8 Jun 2023 21:38:57 +0000 (17:38 -0400)
committerZequan Wu <zequanwu@google.com>
Wed, 14 Jun 2023 20:48:26 +0000 (16:48 -0400)
commit5d54213ee557a86fae82af0f75498adf02f24e82
treee644d918e1c3f1469ed8d4d00ad75a1b75319fee
parentaa495214b39d475bab24b468de7a7c676ce9e366
[Clang][MS] Remove assertion on BaseOffset can't be smaller than Size.

This assertion triggered when we have two base classes sharing the same offset
and the first base is empty and the second class is non-empty.
Remove it for correctness.

I can't add a test case for this because -foverride-record-layout doesn't read
base class info at all. I can add that support later for testing if needed.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D152472
clang/include/clang/Frontend/LayoutOverrideSource.h
clang/lib/AST/RecordLayoutBuilder.cpp
clang/lib/Frontend/LayoutOverrideSource.cpp
clang/test/CodeGenCXX/Inputs/override-layout-ms.layout [new file with mode: 0644]
clang/test/CodeGenCXX/override-layout-ms.cpp [new file with mode: 0644]