This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++11 status.

1152. Expressions parsed differently than intended

Section: [facet.num.put.virtuals] Status: C++11 Submitter: Seungbeom Kim Opened: 2009-06-27 Last modified: 2016-01-28

Priority: Not Prioritized

View other active issues in [facet.num.put.virtuals].

View all other issues in [facet.num.put.virtuals].

View all issues with C++11 status.


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.

[ 2009-10-28 Howard: ]

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

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