)]}'
{
  "commit": "63c29df8ecebb57bdcc04de652afc8d2d98650d7",
  "tree": "ccb7794b8093adc25ef8e83c25d3dca2afb05c78",
  "parents": [
    "ae1d75e6071e51fff924c6904852fc3a2ae56687"
  ],
  "author": {
    "name": "Dmitry Polukhin",
    "email": "34227995+dmpolukhin@users.noreply.github.com",
    "time": "Mon Jun 01 10:02:26 2026 +0100"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon Jun 01 10:02:26 2026 +0100"
  },
  "message": "[Serialization] Fix assertion on re-deserialized friend template spec… (#200566)\n\n…ialization in PCH (#198133)\n\nA friend function-template specialization declared inside a class\ntemplate is serialized into a PCH. When the class template is later\ninstantiated while loading the PCH, the friend specialization can be\ndeserialized re-entrantly (VisitFriendDecl -\u003e VisitFunctionDecl -\u003e ...\n-\u003e VisitFunctionDecl for the same specialization) at the same time as\nthe canonical copy, producing two redeclarations of the same\nspecialization in the template\u0027s specialization set.\n\nASTDeclReader::VisitFunctionDecl asserted that this collision could only\nhappen when merging declarations from different modules. Since\n38b3d87bd384, friend functions defined inside dependent class templates\nare loaded eagerly, so the collision can now also occur within a single\nPCH/AST file (non-modules build), tripping the assertion:\n\n  Assertion failed: (Reader.getContext().getLangOpts().Modules \u0026\u0026\n  \"already deserialized this template specialization\"), function\n  VisitFunctionDecl\n\nThe merge that follows (mergeRedeclarable) already links the two\nredeclarations correctly regardless of whether modules are enabled, so\nthe fix is to drop the modules-only assumption and let the merge run.\n\nFixes https://github.com/llvm/llvm-project/issues/198133",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "6815a275370346a59acd227fe2fec16568fc0bc1",
      "old_mode": 33188,
      "old_path": "clang/lib/Serialization/ASTReaderDecl.cpp",
      "new_id": "fb291a4b0f2c5c9753305743cb9d26436a86f0d2",
      "new_mode": 33188,
      "new_path": "clang/lib/Serialization/ASTReaderDecl.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5ae5bbe22aa5ec48ab79fe1f515a6f8d0d1bd0d4",
      "new_mode": 33188,
      "new_path": "clang/test/PCH/friend-template-spec-redecl.cpp"
    }
  ]
}
