This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/10603: [3.4 regression] [new parser] failing to print problematic token upon parse error
- From: pfeifer at dbai dot tuwien dot ac dot at
- To: gcc-gnats at gcc dot gnu dot org
- Date: 2 May 2003 14:02:01 -0000
- Subject: c++/10603: [3.4 regression] [new parser] failing to print problematic token upon parse error
- Reply-to: pfeifer at dbai dot tuwien dot ac dot at
>Number: 10603
>Category: c++
>Synopsis: [3.4 regression] [new parser] failing to print problematic token upon parse error
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri May 02 14:06:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: pfeifer@dbai.tuwien.ac.at
>Release: unknown-1.0
>Organization:
>Environment:
gcc version 3.4 20030502 (experimental)
>Description:
Our diagnoses for the following piece of code
used to be
int f(int not) {
return 1-not;
}
rather confusing, but now the source of the problem really
is very hard to see:
x.cc:1: error: expected primary-expression
x.cc:1: error: expected `,' or `;'
(Hint: the problem is that "not" is parsed as "!".)
>How-To-Repeat:
% /sw/gcc-3.2.2/bin/g++ x.cc
x.cc:1: parse error before `!' token
x.cc: In function `int f(...)':
x.cc:2: parse error before `;' token
% gccvs x.cc
x.cc:1: error: expected primary-expression
x.cc:1: error: expected `,' or `;'
>Fix:
Also provide the token that lead to the parse error, so that
the user can see the actual problem.
>Release-Note:
>Audit-Trail:
>Unformatted: