)]}'
{
  "commit": "dfe38eb88b4e69be691e3495038d292edff77f36",
  "tree": "bb13724f159a13fa53fb4ca7a4a2d30632f87133",
  "parents": [
    "37724f8a90f0b9ebc5d8883ea0af71edaef2cc35"
  ],
  "author": {
    "name": "Jerry DeLisle",
    "email": "jvdelisle@gcc.gnu.org",
    "time": "Wed May 27 15:10:07 2026 -0700"
  },
  "committer": {
    "name": "Jerry DeLisle",
    "email": "jvdelisle@gcc.gnu.org",
    "time": "Mon Jun 15 08:58:59 2026 -0700"
  },
  "message": "fortran: ICE or wrong-code for ASSOCIATE selector that is a type-bound user-defined operator\n\nThree related bugs prevented ASSOCIATE selectors that are type-bound\nuser-defined operator expressions from compiling correctly.\n\nBug 1 (class.cc): find_typebound_proc_uop returned NULL immediately when\nthe derived type has no f2k_derived namespace, bypassing the parent-type\ninheritance walk.  This caused inherited UDOs to be silently not found.\nFix: set root \u003d NULL and let the loop reach the parent type instead.\n\nBug 2 (resolve.cc): resolve_typebound_procedures called resolve_symbol on\nthe parent type only after an early return that fires when the derived type\nhas no direct type-bound bindings.  This left parent-type bindings\nunresolved when searched via gfc_find_typebound_user_op.\nFix: move resolve_symbol(super_type) before the early return.\n\nBug 3 (match.cc): match_association_list did not handle ASSOCIATE selectors\nof the form .uop. expr or the nested case .uop2. (.uop1. expr).  When the\nselector\u0027s type was BT_UNKNOWN at parse time the name of the associate\nvariable was left untyped, producing a \"Syntax error in expression\" ICE in\nthe body of the ASSOCIATE construct.\n\nAdd three helpers before match_association_list:\n  - resolve_assoc_operand: attempts gfc_resolve_expr on EXPR_FUNCTION\n    operands and falls back to gfc_find_dt_in_generic for constructor calls\n    whose argument types are not yet known.\n  - infer_typebound_uop_type: reads the return type of a type-bound UDO\n    directly from specific_st-\u003en.tb-\u003eu.specific-\u003en.sym without calling\n    gfc_resolve_symbol, avoiding a resolve_symbol_called race condition.\n  - extend_assoc_op: walks the expression tree bottom-up, propagating\n    types through INTRINSIC_PARENTHESES wrappers before calling the two\n    helpers above on each INTRINSIC_USER node.\n\nWhen the selector is an INTRINSIC_USER EXPR_OP with BT_UNKNOWN type,\ncall extend_assoc_op on the operands, then gfc_extend_expr (errors\nsuppressed).  Accept the result when gfc_extend_expr returns MATCH_YES or\nwhen it returns MATCH_ERROR but has already converted the node to\nEXPR_COMPCALL with a known type (the full resolution pass finishes it).\n\nAssisted-by: Claude Sonnet 4.6\n\n\tPR fortran/125528\n\ngcc/fortran/ChangeLog:\n\n\t* class.cc (find_typebound_proc_uop): Set root \u003d NULL instead of\n\treturning NULL when derived type lacks f2k_derived, so parent-type\n\ttype-bound procedures and operators are still found via inheritance.\n\t* match.cc (resolve_assoc_operand): New helper.\n\t(infer_typebound_uop_type): New helper.\n\t(extend_assoc_op): New helper.\n\t(match_association_list): Handle ASSOCIATE selectors that are\n\ttype-bound user-defined operator expressions, including nested cases.\n\t* resolve.cc (resolve_typebound_procedures): Move resolve_symbol\n\tcall for the parent type before the early return so inherited\n\ttype-bound bindings are resolved even when the child type has none\n\tof its own.\n\ngcc/testsuite/ChangeLog:\n\n\t* gfortran.dg/associate_80.f90: New test.\n\n(cherry picked from commit 6340639219bb2d1816c94e5de76ec3642453bcb2)\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "9c02b9bc81e9691b01377c3d370892322b2fbc20",
      "old_mode": 33188,
      "old_path": "gcc/fortran/class.cc",
      "new_id": "4073ca3330dc3c4e9607a2711541fa7344e17e0e",
      "new_mode": 33188,
      "new_path": "gcc/fortran/class.cc"
    },
    {
      "type": "modify",
      "old_id": "3fd42890239b17eabaca67c6db0d7f89af0e5215",
      "old_mode": 33188,
      "old_path": "gcc/fortran/match.cc",
      "new_id": "8055416b3ccb4be08b1a1ffb85f0b98f0187a193",
      "new_mode": 33188,
      "new_path": "gcc/fortran/match.cc"
    },
    {
      "type": "modify",
      "old_id": "90fc7b1cfe78ce8139ee9d44d50874f42ec16876",
      "old_mode": 33188,
      "old_path": "gcc/fortran/resolve.cc",
      "new_id": "b095f043058d79f0af00e98d1c7950bd5e68dd83",
      "new_mode": 33188,
      "new_path": "gcc/fortran/resolve.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "14c405c8f22063f5df66434e70d2c70c77daf40e",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gfortran.dg/associate_80.f90"
    }
  ]
}
