)]}'
{
  "commit": "383733ea8d15524517b0f1f15c8380c24f17407d",
  "tree": "cc22e64a4c5b5dfedf7160c8ee41302cf1e3885f",
  "parents": [
    "eac20c0e507cf3fd02fde13e5e04993e1f92a664"
  ],
  "author": {
    "name": "Bruno Cardoso Lopes",
    "email": "bruno.cardoso@gmail.com",
    "time": "Wed Apr 29 00:55:35 2026"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Apr 29 00:55:35 2026"
  },
  "message": "[CIR] Always set base subobject type for C++ records (#194504)\n\nFor unions and final C++ classes, computeRecordLayout previously left\nthe base-subobject type as a default-constructed (null) cir::RecordType.\nThe non-virtual size always equals the size for those kinds of records,\nso no separate \".base\" variant is needed, but `BaseSubobjectType` itself\nwas never set to the complete type either.\n\nThat null leaked through\ngetCIRGenRecordLayout(RD).getBaseSubobjectCIRType(), which is called by\ngetStorageType(const CXXRecordDecl *) when laying out a\n[[no_unique_address]] / potentially-overlapping field. The null\nmlir::Type was then stored as MemberInfo::data and tripped a\nSmallVector::back() !empty() assertion in\nCIRRecordLowering::fillOutputFields, because a member with null data is\ninterpreted as a bitfield placeholder and reads fieldTypes.back() that\nwas never pushed.\n\nMatch classic CodeGen (CGRecordLayoutBuilder.cpp) and unconditionally\nset baseTy \u003d *ty for any CXXRecordDecl, only constructing a separate\n\".base\" record when nv-size !\u003d size (which excludes unions and final\nclasses by construction).\n\nReproducer:\n```\n  union U { int a; long b; };\n  struct S {\n    [[no_unique_address]] U u;\n    int x;\n  } s;\n```\n\nThis comes from a crash on the libc++ test-suite (~1,500 tests affected,\nall crashing inside CIRRecordLowering::lower while laying out\n__compressed_pair_padding-style structs in \u003cstring\u003e).",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6947fd257f47fcf0e49bfa018e1927989f96c3cf",
      "old_mode": 33188,
      "old_path": "clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp",
      "new_id": "8399d6a333006d71146ffb4815d969fff44701ec",
      "new_mode": 33188,
      "new_path": "clang/lib/CIR/CodeGen/CIRGenRecordLayoutBuilder.cpp"
    },
    {
      "type": "modify",
      "old_id": "da64b5078ba53f7f6b87dbba5f060756c09f033b",
      "old_mode": 33188,
      "old_path": "clang/test/CIR/CodeGen/no-unique-address.cpp",
      "new_id": "82eef4d3a08381249d3248fc0a7cb2b718887c40",
      "new_mode": 33188,
      "new_path": "clang/test/CIR/CodeGen/no-unique-address.cpp"
    }
  ]
}
