1152. Expressions parsed differently than intended

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

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.

Discussion:

In Table 73 — Floating-point conversions, 25.4.2.2.2 [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 25.4.2.2.2 [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