2.2.0 rc1 regression with cdecl functions
              The one with `cdecl` has nothing to do with templates, simplified:

```nim
type Object = object
  a: int
  b: ref int
var x = 0
proc fn(): auto {.cdecl.} =
  inc x
  return Object()
discard fn()
doAssert x == 1
```

Both `a: int` and `b: ref int` need to exist for some reason.

Locally this seems caused by #23409, not sure if there's a reason the bisect bot couldn't figure it out.

Also thanks for fixing the regressions from #23681, I didn't have time to look at them.

_Originally posted by @metagn in https://github.com/nim-lang/Nim/issues/23836#issuecomment-2229585938_
            