Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Defect: expressions parsed differently than intended (N2914)

3 views
Skip to first unread message

Seungbeom Kim

unread,
Jun 27, 2009, 1:13:45 AM6/27/09
to
In Table 73 � Floating-point conversions, [facet.num.put.virtuals],
in N2914, we have the following entries:

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.

I couldn't find this issue in the C++ Standard Library Issues List
(Revision R65).

--
Seungbeom Kim


[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std...@netlab.cs.rpi.edu]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]

Howard Hinnant

unread,
Jun 29, 2009, 12:06:08 PM6/29/09
to
On Jun 27, 1:13 am, Seungbeom Kim <musip...@bawi.org> wrote:
> In Table 73 — Floating-point conversions, [facet.num.put.virtuals],

> in N2914, we have the following entries:
>
> 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.
>
> I couldn't find this issue in the C++ Standard Library Issues List
> (Revision R65).

This is now LWG issue 1152:

http://home.roadrunner.com/~hinnant/issue_review/lwg-active.html#1152

-Howard


--

0 new messages