This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Newbie: C++ Frontend Lexical Analysis Issue, <::abs(n) does not parse
- From: Thierry Moreau <thierry dot moreau at connotech dot com>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 27 Mar 2004 10:37:33 -0500
- Subject: Newbie: C++ Frontend Lexical Analysis Issue, <::abs(n) does not parse
The following sample fails to compile by GCC, and I am surprised:
===========================
// sample.cpp
int abs(int x)
{ return (x>=0)?x:-x; }
class A {
protected:
int m,n;
public:
int g(void);
int h(void);
};
int A::g(void)
{ return ::abs(m) < ::abs(n); }
int A::h(void)
{ return ::abs(m)<::abs(n); } /* parse error here (!) */
===========================
Obviously, there is a simple work-around.
Please excuse my reluctance to file an official bug report in another problem reporting service.
Again and again, many many thanks to all those who brings the GCC technology to life!
--
- Thierry Moreau
CONNOTECH Experts-conseils inc.
9130 Place de Montgolfier
Montreal, Qc
H2M 2A1
Tel.: (514)385-5691
Fax: (514)385-5900
web site: http://www.connotech.com
e-mail: thierry.moreau@connotech.com