Title
Expressions parsed differently than intended
Status
c++11
Section
[facet.num.put.virtuals]
Submitter
Seungbeom Kim

Created on 2009-06-27.00:00:00 last changed 143 months ago

Messages

Date: 2013-01-25.00:32:43

Proposed resolution:

Change Table 83 — Floating-point conversions in [facet.num.put.virtuals]:

Table 83 — Floating-point conversions
State stdio equivalent
floatfield == (ios_base::fixed | ios_base::scientific) && !uppercase %a
floatfield == (ios_base::fixed | ios_base::scientific) %A
Date: 2009-10-28.00:00:00

[ 2009-10-28 Howard: ]

Moved to Tentatively Ready after 5 positive votes on c++std-lib.

Date: 2009-06-27.00:00:00

In Table 73 — Floating-point conversions, [facet.num.put.virtuals], in N2914, we have the following entries:

Table 73 — Floating-point conversions
State stdio equivalent
floatfield == ios_base::fixed | ios_base::scientific && !uppercase %a
floatfield == ios_base::fixed | ios_base::scientific %A

These expressions are supposed to mean:

floatfield == (ios_base::fixed | ios_base::scientific) && !uppercase 
floatfield == (ios_base::fixed | ios_base::scientific) 

but technically parsed as:

((floatfield == ios_base::fixed) | ios_base::scientific) && (!uppercase) 
((floatfield == ios_base::fixed) | ios_base::scientific) 

and should be corrected with additional parentheses, as shown above.

History
Date User Action Args
2013-01-25 00:32:43adminsetmessages: + msg6338
2013-01-25 00:32:43adminsetmessages: + msg6337
2009-06-27 00:00:00admincreate