This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]