Title
Missing parentheses around subexpression
Status
cd1
Section
[iostate.flags]
Submitter
Martin Sebor

Created on 2000-11-02.00:00:00 last changed 164 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Add parentheses like so: rdstate()==(state|ios_base::badbit).

Date: 2000-11-02.00:00:00

27.4.4.3, p4 says about the postcondition of the function: If rdbuf()!=0 then state == rdstate(); otherwise rdstate()==state|ios_base::badbit.

The expression on the right-hand-side of the operator==() needs to be parenthesized in order for the whole expression to ever evaluate to anything but non-zero.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2071
2000-11-02 00:00:00admincreate