Bug 59030 - [4.9 Regression] Caret diagnostic always points to the first line
Summary: [4.9 Regression] Caret diagnostic always points to the first line
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.9.0
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2013-11-06 20:17 UTC by Volker Reichelt
Modified: 2013-11-07 12:19 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.9.0
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2013-11-06 20:17:19 UTC
With today's trunk (4.9.0 20131106) the caret diagnostic always points to the first line, although the line number is correct. 

======================
// First line

int i = 0;

int j = ;
======================

The above invalid code snippet produces the error message:

====================================================================
bug.cc:5:9: error: expected primary-expression before ';' token
 // First line
         ^
====================================================================
Comment 1 Volker Reichelt 2013-11-06 20:19:52 UTC
With yesterday's build I got a correct diagnostic:

====================================================================
bug.cc:5:9: error: expected primary-expression before ';' token
 int j = ;
         ^
====================================================================
Comment 2 Manuel López-Ibáñez 2013-11-07 00:10:29 UTC
It would be nice to have a few silly tests for caret diagnostics in the testsuite, but I think dejagnu was making this far from trivial. Perhaps things have improved since then.
Comment 3 Paolo Carlini 2013-11-07 09:44:55 UTC
Today I can't reproduce this. Please double check.
Comment 4 Richard Biener 2013-11-07 11:15:07 UTC
Appearantly got fixed meanwhile.
Comment 5 Volker Reichelt 2013-11-07 12:19:36 UTC
The offending patch got reverted:

http://gcc.gnu.org/ml/gcc-cvs/2013-11/msg00212.html