Some restaurants take credit cards but won't let you add a tip to the card.
Free churches sometimes have a coin-operated box that illuminates the mosaic, fresco or sculpture you want to see. Those boxes usually take 1-euro coins, but there is some variation.
Donation boxes at churches are normally cash-only. Ditto if you want to buy a candle to light.
If you need to buy city bus/tram tickets from a newsstand or tobacco shop (or from anywhere other than a person or machine belonging to the transit company), you'll have to use cash.
I noticed in Rome a few months ago that most people were paying with cash at gelato shops. I assume most if not all gelato places accept credit cards but prefer cash for those 3-euro sales.
I had a museum in one of the Baltic countries tell me I had to pay for my (very inexpensive) senior-discount entry with cash but could use a credit card for a full-price ticket.
Some luggage lockers take coins. I don't know whether you'll encounter coin-operated lockers at many museums these days. Many are now free (you're usually paying to enter the museum); others use free wooden or metal tokens.
A lot of beverage and snack vending machines have been retrofitted to take credit cards, but I don't know how universal that is.
As for public toilets, sometimes the ones that take credit cards won't like your card, or perhaps anyone's card on that particular day.