[all-commits] [llvm/llvm-project] 5d5421: [Clang][MS] Remove assertion on BaseOffset can't b...

Zequan Wu via All-commits all-commits at lists.llvm.org
Wed Jun 14 13:48:39 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5d54213ee557a86fae82af0f75498adf02f24e82
      https://github.com/llvm/llvm-project/commit/5d54213ee557a86fae82af0f75498adf02f24e82
  Author: Zequan Wu <zequanwu at google.com>
  Date:   2023-06-14 (Wed, 14 Jun 2023)

  Changed paths:
    M clang/include/clang/Frontend/LayoutOverrideSource.h
    M clang/lib/AST/RecordLayoutBuilder.cpp
    M clang/lib/Frontend/LayoutOverrideSource.cpp
    A clang/test/CodeGenCXX/Inputs/override-layout-ms.layout
    A clang/test/CodeGenCXX/override-layout-ms.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list