Only when TSA is providing security for the flight - ie. US flights.
I've had contact lens solution confiscated from me in Heathrow (London). I was bummed and annoyed at myself that I hadn't anticipated that. I've learned to check my bigger bottle (if checking) or carry on multiple small ones (if doing carry on only). The solution I use isn't readily available.
CATSA (Canadian airports) also exempts saline solution.
But yes, definitely check the rules for the country you are flying out of.