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

gsd@dolphin.fr gsd@dolphin.fr
Tue Jul 30 01:05:00 GMT 2002


>Number:         7440
>Category:       c++
>Synopsis:       parse error on valid C++ code (parse error before `&&' token)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 30 00:46:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     gsd@dolphin.fr
>Release:        gcc (GCC) 3.1.1
>Organization:
>Environment:
Solaris 2.5.1
>Description:
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

This code compiles fine with gcc-3.1.1 (C), gcc-2.95.3 (C), g++-2.95.3 (C++), MS Visual C++ (C/C++).
>How-To-Repeat:
Compile the following source using g++:

inline const long and(const long L, const long R) { return (L && R); }
>Fix:
unknown
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list