[Lldb-commits] [lldb] [LLDB][NativePDB] Add non-overlapping fields in root struct (PR #166243)

via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 4 01:08:54 PST 2025


================
@@ -243,3 +255,44 @@ TEST_F(UdtRecordCompleterRecordTests, TestNestedUnionStructInUnion) {
   AddField(s2, "m4", 2, 4, Member::Field);
   EXPECT_EQ(WrappedRecord(this->record), WrappedRecord(record));
 }
+
+TEST_F(UdtRecordCompleterRecordTests, TestNestedUnionStructInUnion2) {
+  SetKind(Member::Kind::Union);
----------------
Nerixyz wrote:

It's testing that we don't do this "going up one level" everywhere. In this test, `m7` does not overlap `m5`, so it could be placed in the outer struct:

```cpp
union {
  m1;
  m2;
  struct {
      m3;
      m4;
      union {
          m5;
          m6;
      };
      m7;
  };
};
```


https://github.com/llvm/llvm-project/pull/166243


More information about the lldb-commits mailing list