This is the mail archive of the gcc-prs@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]

Re: c++/7440: parse error on valid C++ code (parse error before `&&' token)


The following reply was made to PR c++/7440; it has been noted by GNATS.

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: gsd@dolphin.fr
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: c++/7440: parse error on valid C++ code (parse error before `&&' token)
Date: 30 Jul 2002 10:02:02 +0200

 gsd@dolphin.fr writes:
 
 [...]
 
 | Compiling the one line C++ source file using g++:
 | 
 | inline const long and(const long L, const long R) { return (L && R); }
                     ^^^
 | 
 | produces the error message:
 | 
 | 1: parse error before `&&' token
 
 Indeed.  This is not a bug in the compiler.  It is a bug in your
 program source: "and" is an alternate spelling for "&&" so you cannot
 use it as a regular identifier.
 
 -- Gaby


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