basic_ios::setstate

void setstate(iostate state);

The member function effectively calls clear(state | rdstate()).