This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Newbie: C++ Frontend Lexical Analysis Issue, <::abs(n) does notparse
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Thierry Moreau <thierry dot moreau at connotech dot com>
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 27 Mar 2004 15:34:44 -0800
- Subject: Re: Newbie: C++ Frontend Lexical Analysis Issue, <::abs(n) does notparse
- References: <40659FBD.4050106@connotech.com>
Thierry Moreau <thierry.moreau@connotech.com> writes:
> The following sample fails to compile by GCC, and I am surprised:
...
> { return ::abs(m)<::abs(n); } /* parse error here (!) */
When the two characters <: appear next to each other like this, it is
taken as an alternate spelling ("digraph") for a [ token. The point
of this is to make it easier to write C on the (rare) platforms which
do not have an [ character. This is an awkward feature but the
language standard requires it.
Inserting a space is the correct fix.
> Please excuse my reluctance to file an official bug report in
> another problem reporting service.
Huh? Is there a problem with our bug tracking system?
zw