basic_ios::fail

bool fail() const;

The member function returns true if rdstate() & failbit.