Problem solved! It seems to have been an issue with the tool chain version.
I was using the avr tools installed by my distribution (archlinux), so under "Tools > Boards" I have "Archlinux Arduino AVR boards > Arduino Uno". I installed "Arduino AVR boards" from the board manager and now it works. When I select the Uno from the "Archlinux AVR" submenu, the compiler is:
$ avr-g++ --version
avr-g++ (GCC) 11.1.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
but from the "Arduino AVR" submenu it's:
$ .arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ --version
avr-g++ (GCC) 7.3.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
With the older version (7.3.0), OpenCat.ino compiles fine:
Sketch uses 29054 bytes (90%) of program storage space. Maximum is 32256 bytes.
That doesn't really explain why it worked earlier and gave me trouble now, but that's fine. At least I've got it working, and hopefully this will be helpful to someone else sometime!