public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/31754]  New: Include character count along line in error messages main.cpp:5:38
@ 2007-04-29 12:55 jg at jguk dot org
  2007-04-29 15:45 ` [Bug other/31754] Include column number " pinskia at gcc dot gnu dot org
                   ` (23 more replies)
  0 siblings, 24 replies; 26+ messages in thread
From: jg at jguk dot org @ 2007-04-29 12:55 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1923 bytes --]

Often we have compile errors on long lines of code, it is time-consuming to
find the actual character offset on the long line which is causing the error.
Sometimes it is even necessary to separate out long if(..) statements, so we
can figure out which part of the long line has the problem in the error
message.

Could gcc indicate the character offset along the line? Not sure how easy this
would be to do, but perhaps the code which is generating the error has the
character offset along the line.

For example, see this obvious example code build below:
$ g++ -Wall -o t main.cpp
main.cpp: In function ‘int main()’:
main.cpp:9: error: wrong type argument to unary minus


character 38 is the start of the erroneous unary minus, so the error message
could be clearer as:
$ g++ -Wall -o t main.cpp
main.cpp: In function ‘int main()’:
main.cpp:9:38 error: wrong type argument to unary minus

Example program follows:
========================
// g++ -Wall -o t main.cpp
#include <string.h>
#include <cstdio>
int main()
{
        char * buf0;
        char * buf1;
        char * buf2;
        if((buf0 = strdup("buf0")) && (buf1 +- strdup("buf1")) && (buf2 =
strdup("buf2")))
        {
                printf("All strings duplicated\n");
        }

        return 0;
}
=============================

I am running GNU C++ version 4.1.2 20060928 (prerelease) (Ubuntu
4.1.1-13ubuntu5) (i486-linux-gnu)


-- 
           Summary: Include character count along line in error messages
                    main.cpp:5:38
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jg at jguk dot org
 GCC build triplet: i486-linux-gnu
  GCC host triplet: i486-linux-gnu
GCC target triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
@ 2007-04-29 15:45 ` pinskia at gcc dot gnu dot org
  2007-10-26  5:36 ` tromey at gcc dot gnu dot org
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-29 15:45 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
            Summary|Include character count     |Include column number along
                   |along line in error messages|line in error messages
                   |main.cpp:5:38               |main.cpp:5:38


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
  2007-04-29 15:45 ` [Bug other/31754] Include column number " pinskia at gcc dot gnu dot org
@ 2007-10-26  5:36 ` tromey at gcc dot gnu dot org
  2008-06-16 11:14 ` dseketel at redhat dot com
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: tromey at gcc dot gnu dot org @ 2007-10-26  5:36 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 982 bytes --]



------- Comment #1 from tromey at gcc dot gnu dot org  2007-10-26 05:35 -------
Note that even with mapped locations this gives the wrong result.
The C++ parser has some column-number bugs.

opsy. g++ -Wall -fsyntax-only z.cc
z.cc: In function ‘int main()’:
z.cc:8:61: error: wrong type argument to unary minus

Column 61 is the closing paren around the "+" expression.
Column 46 would be best.


-- 

tromey at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-26 05:35:43
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
  2007-04-29 15:45 ` [Bug other/31754] Include column number " pinskia at gcc dot gnu dot org
  2007-10-26  5:36 ` tromey at gcc dot gnu dot org
@ 2008-06-16 11:14 ` dseketel at redhat dot com
  2008-06-16 11:15 ` dseketel at redhat dot com
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dseketel at redhat dot com @ 2008-06-16 11:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from dseketel at redhat dot com  2008-06-16 11:13 -------
Created an attachment (id=15774)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15774&action=view)
produce more accurate column information in error messages

This patch modifies the c++ parser to produce more accurate column information
in error messages.

The basic idea of the patch is to not use the global input_location variable to
generate line/columns info in error messages, but rather to pass the right
token location to each error message.

For now, I have mostly touched only the parsing code. Semantic analysis code
has not been touched yet. I have not touched warning generation code either.

I have started to make the error tests in testsuite/g++.dg/parse/ be column
aware by forcing the -fshow-column flag on these tests as well. It is looking
good so far. I realised that -fno-show-column was forced in
gcc/testsuite/lib/g++.exp. So I commented that so that -fshow-column flag can
take effect when triggered.

This patch is work in progress and I will update it here until it becomes solid
enought to be posted to the gcc-patches mailing list.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (2 preceding siblings ...)
  2008-06-16 11:14 ` dseketel at redhat dot com
@ 2008-06-16 11:15 ` dseketel at redhat dot com
  2008-06-18 18:25 ` dseketel at redhat dot com
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dseketel at redhat dot com @ 2008-06-16 11:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dseketel at redhat dot com  2008-06-16 11:15 -------
I forgot to say that my patch just affects the c++ front end of gcc.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (3 preceding siblings ...)
  2008-06-16 11:15 ` dseketel at redhat dot com
@ 2008-06-18 18:25 ` dseketel at redhat dot com
  2008-06-18 19:21 ` dseketel at redhat dot com
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dseketel at redhat dot com @ 2008-06-18 18:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from dseketel at redhat dot com  2008-06-18 18:24 -------
Created an attachment (id=15778)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15778&action=view)
more work on the error location patch

This patch makes all the tests in testsuite/g++.dg/parse/error*.C be aware of
column numbers in error messages. It makes those tests run with -fshow-column.
During that process, some pbs with the code were discovered and fixed.
Also did some cleanups of the initial patch after some comments from Tom
Tromey.

This should apply to trunk as of 2008-06-18.


-- 

dseketel at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #15774|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (4 preceding siblings ...)
  2008-06-18 18:25 ` dseketel at redhat dot com
@ 2008-06-18 19:21 ` dseketel at redhat dot com
  2008-06-20  9:54 ` dseketel at redhat dot com
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dseketel at redhat dot com @ 2008-06-18 19:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dseketel at redhat dot com  2008-06-18 19:20 -------
Created an attachment (id=15780)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15780&action=view)
work in progress on more accurate column numbers

Fix some compilation errors after rebasing to trunk.


-- 

dseketel at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #15778|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (5 preceding siblings ...)
  2008-06-18 19:21 ` dseketel at redhat dot com
@ 2008-06-20  9:54 ` dseketel at redhat dot com
  2008-06-20 12:05 ` dseketel at redhat dot com
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dseketel at redhat dot com @ 2008-06-20  9:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dseketel at redhat dot com  2008-06-20 09:53 -------
Created an attachment (id=15793)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15793&action=view)
rebase against current trunk

Rebased against current trunk.


-- 

dseketel at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #15780|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (6 preceding siblings ...)
  2008-06-20  9:54 ` dseketel at redhat dot com
@ 2008-06-20 12:05 ` dseketel at redhat dot com
  2008-06-26 12:39 ` dseketel at redhat dot com
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dseketel at redhat dot com @ 2008-06-20 12:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from dseketel at redhat dot com  2008-06-20 12:05 -------
(From update of attachment 15793)
This version of the patch got sent to the mailing list at
http://gcc.gnu.org/ml/gcc-patches/2008-06/msg01329.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (7 preceding siblings ...)
  2008-06-20 12:05 ` dseketel at redhat dot com
@ 2008-06-26 12:39 ` dseketel at redhat dot com
  2008-06-27 21:32 ` dseketel at redhat dot com
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dseketel at redhat dot com @ 2008-06-26 12:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from dseketel at redhat dot com  2008-06-26 12:38 -------
Created an attachment (id=15817)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15817&action=view)
correct issues raised by reviews on the mailing list

I have corrected the issues raised at
http://gcc.gnu.org/ml/gcc-patches/2008-06/msg01552.html.

I have also refreshed the patch against trunk of 2008-06-25.


-- 

dseketel at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #15793|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (8 preceding siblings ...)
  2008-06-26 12:39 ` dseketel at redhat dot com
@ 2008-06-27 21:32 ` dseketel at redhat dot com
  2008-06-28  1:00 ` jg at jguk dot org
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dseketel at redhat dot com @ 2008-06-27 21:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from dseketel at redhat dot com  2008-06-27 21:31 -------
Created an attachment (id=15821)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15821&action=view)
better column number in error patch [2/2]

After applying this patch, all calls to error() gcc/cp/parser.c use an
"accurate" location.
The remaining calls that use the global input_location variable are outside of
the parser.
Some impacted tests have been updated to catch column number regressions.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (9 preceding siblings ...)
  2008-06-27 21:32 ` dseketel at redhat dot com
@ 2008-06-28  1:00 ` jg at jguk dot org
  2008-06-30 17:51 ` dseketel at redhat dot com
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: jg at jguk dot org @ 2008-06-28  1:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jg at jguk dot org  2008-06-28 01:00 -------
Dodji Seketeli, Just a quick note to say how great it is that you're working in
this enhancement. Cheers, Jon


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (10 preceding siblings ...)
  2008-06-28  1:00 ` jg at jguk dot org
@ 2008-06-30 17:51 ` dseketel at redhat dot com
  2008-06-30 17:53 ` dseketel at redhat dot com
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dseketel at redhat dot com @ 2008-06-30 17:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from dseketel at redhat dot com  2008-06-30 17:51 -------
Created an attachment (id=15835)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15835&action=view)
better column number in error patch [1/2]

This is a rebase of the patch [1/2] against trunk from 2008-06-30.


-- 

dseketel at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #15817|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (11 preceding siblings ...)
  2008-06-30 17:51 ` dseketel at redhat dot com
@ 2008-06-30 17:53 ` dseketel at redhat dot com
  2008-06-30 17:55 ` dseketel at redhat dot com
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dseketel at redhat dot com @ 2008-06-30 17:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from dseketel at redhat dot com  2008-06-30 17:52 -------
Created an attachment (id=15836)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15836&action=view)
better column number in error patch [2/2]

This is a rebase of the patch [2/2] against trunk of 2008-06-30.
It has been regtested on x86.


-- 

dseketel at redhat dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #15821|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (12 preceding siblings ...)
  2008-06-30 17:53 ` dseketel at redhat dot com
@ 2008-06-30 17:55 ` dseketel at redhat dot com
  2008-07-01 16:30 ` dseketel at redhat dot com
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dseketel at redhat dot com @ 2008-06-30 17:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from dseketel at redhat dot com  2008-06-30 17:54 -------
@Jon Grant: thanks for cheering ! :-)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (13 preceding siblings ...)
  2008-06-30 17:55 ` dseketel at redhat dot com
@ 2008-07-01 16:30 ` dseketel at redhat dot com
  2008-07-10 14:38 ` dodji at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dseketel at redhat dot com @ 2008-07-01 16:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from dseketel at redhat dot com  2008-07-01 16:29 -------
Hello,

Just a quick comment on this bug.

I think that in the example you gave, gcc (at the least 4.3.0 version) is
giving a correct column location.

The expression gcc is complaining about is:

"a +- b".

That expression is normally valid, an can be re-written as a + -b (like in 2 +
-3).
In that case, the '-' is called an "unary minus" operator.

In your case, the reason why gcc is complaining is because 'b' is of type
pointer. And you cannot apply the "unary minus" operator to a pointer.

So gcc complains about the _operand_, saying the operand is of the wrong type.
That is why gcc is referering to the operand, instead of refering to the '-'.

On the other hand, it is notorious that gcc does not display extremely accurate
column numbers in error message. Hopefully, that situation can get better with
the patches attached above.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (14 preceding siblings ...)
  2008-07-01 16:30 ` dseketel at redhat dot com
@ 2008-07-10 14:38 ` dodji at gcc dot gnu dot org
  2008-07-11 12:55 ` dodji at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dodji at gcc dot gnu dot org @ 2008-07-10 14:38 UTC (permalink / raw)
  To: gcc-bugs



-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|dseketel at redhat dot com  |
         AssignedTo|unassigned at gcc dot gnu   |dodji at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-10-26 05:35:43         |2008-07-10 14:37:28
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (15 preceding siblings ...)
  2008-07-10 14:38 ` dodji at gcc dot gnu dot org
@ 2008-07-11 12:55 ` dodji at gcc dot gnu dot org
  2008-07-11 16:34 ` dodji at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dodji at gcc dot gnu dot org @ 2008-07-11 12:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from dodji at gcc dot gnu dot org  2008-07-11 12:55 -------
Subject: Bug 31754

Author: dodji
Date: Fri Jul 11 12:54:22 2008
New Revision: 137716

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137716
Log:
2008-07-11 Dodji Seketeli <dseketel@redhat.com>

        PR c++/31754
        * pt.c, semantic.c:
        * semantic.c (qualified_name_lookup_error, finish_id_expression):
        add a location_t parameter so that
        error message can have a more accurate location.
        * cp-tree.h: updated prototype
        * pt.c (tsubst_qualified_id): use location in error messages.
        * parser.c (cp_parser_postfix_expression,
        cp_parser_objc_statement, cp_parser_trait_expr,
        cp_parser_token_is_class_key,
        cp_parser_uncommitted_to_tentative_parse_p,
        cp_parser_check_for_invalid_template_id, cp_parser_is_string_literal,
        cp_parser_error, cp_parser_name_lookup_error,
        cp_parser_simulate_error, cp_parser_check_decl_spec,
        cp_parser_check_decl_spec, cp_parser_non_integral_constant_expression,
        cp_parser_diagnose_invalid_type_name,
        cp_parser_parse_and_diagnose_invalid_type_name,
        cp_parser_require_pragma_eol, cp_parser_make_typename_type,
        cp_parser_string_literal, cp_parser_primary_expression,
        cp_parser_primary_expression, cp_parser_unqualified_id,
        cp_parser_nested_name_specifier_opt, cp_parser_postfix_expression,
        cp_parser_postfix_dot_deref_expression, cp_parser_new_expression,
        cp_parser_direct_new_declarator, cp_parser_builtin_offsetof,
        cp_parser_label_for_labeled_statement, cp_parser_statement_seq_opt,
        cp_parser_jump_statement, cp_parser_block_declaration,
        cp_parser_simple_declaration, cp_parser_decl_specifier_seq,
        cp_parser_function_specifier_opt, cp_parser_decltype,
        cp_parser_mem_initializer_list, cp_parser_mem_initializer,
        cp_parser_mem_initializer_id, cp_parser_template_parameter,
        cp_parser_type_parameter, cp_parser_template_id,
cp_parser_template_name,
        cp_parser_template_argument): likewise.


Added:
    trunk/gcc/testsuite/g++.dg/parse/error-column.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/pt.c
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/parse/constructor1.C
    trunk/gcc/testsuite/g++.dg/parse/error1.C
    trunk/gcc/testsuite/g++.dg/parse/error10.C
    trunk/gcc/testsuite/g++.dg/parse/error11.C
    trunk/gcc/testsuite/g++.dg/parse/error12.C
    trunk/gcc/testsuite/g++.dg/parse/error13.C
    trunk/gcc/testsuite/g++.dg/parse/error14.C
    trunk/gcc/testsuite/g++.dg/parse/error15.C
    trunk/gcc/testsuite/g++.dg/parse/error16.C
    trunk/gcc/testsuite/g++.dg/parse/error17.C
    trunk/gcc/testsuite/g++.dg/parse/error18.C
    trunk/gcc/testsuite/g++.dg/parse/error19.C
    trunk/gcc/testsuite/g++.dg/parse/error2.C
    trunk/gcc/testsuite/g++.dg/parse/error20.C
    trunk/gcc/testsuite/g++.dg/parse/error21.C
    trunk/gcc/testsuite/g++.dg/parse/error22.C
    trunk/gcc/testsuite/g++.dg/parse/error23.C
    trunk/gcc/testsuite/g++.dg/parse/error24.C
    trunk/gcc/testsuite/g++.dg/parse/error25.C
    trunk/gcc/testsuite/g++.dg/parse/error26.C
    trunk/gcc/testsuite/g++.dg/parse/error27.C
    trunk/gcc/testsuite/g++.dg/parse/error28.C
    trunk/gcc/testsuite/g++.dg/parse/error29.C
    trunk/gcc/testsuite/g++.dg/parse/error3.C
    trunk/gcc/testsuite/g++.dg/parse/error30.C
    trunk/gcc/testsuite/g++.dg/parse/error31.C
    trunk/gcc/testsuite/g++.dg/parse/error4.C
    trunk/gcc/testsuite/g++.dg/parse/error5.C
    trunk/gcc/testsuite/g++.dg/parse/error6.C
    trunk/gcc/testsuite/g++.dg/parse/error7.C
    trunk/gcc/testsuite/g++.dg/parse/error8.C
    trunk/gcc/testsuite/g++.dg/parse/error9.C
    trunk/gcc/testsuite/g++.old-deja/g++.pt/niklas01a.C
    trunk/gcc/testsuite/lib/g++.exp


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (16 preceding siblings ...)
  2008-07-11 12:55 ` dodji at gcc dot gnu dot org
@ 2008-07-11 16:34 ` dodji at gcc dot gnu dot org
  2008-07-11 16:36 ` dodji at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dodji at gcc dot gnu dot org @ 2008-07-11 16:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from dodji at gcc dot gnu dot org  2008-07-11 16:33 -------
Subject: Bug 31754

Author: dodji
Date: Fri Jul 11 16:32:29 2008
New Revision: 137721

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=137721
Log:
2008-07-11  Dodji Seketeli  <dseketel@redhat.com>

        PR c++/31754
        * cp-tree.h (struct cp_decl_specifier_seq): add a location field. It
        carries the location of the primary type.
        * parser.c (cp_parser_check_type_definition): update documentation.
        (cp_parser_check_for_definition_in_return_type,
        cp_parser_check_for_invalid_template_id,
        cp_parser_set_decl_spec_type,
        cp_parser_check_for_definition_in_return_type,
        cp_parser_diagnose_invalid_type_name,
        cp_parser_new_expression, cp_parser_explicit_instantiation,
        cp_parser_type_specifier, cp_parser_simple_type_specifier,
        cp_parser_omp_for_loop, cp_parser_pragma): use location in error
messages.


Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/other/semicolon.C
    trunk/gcc/testsuite/g++.dg/parse/error15.C
    trunk/gcc/testsuite/g++.old-deja/g++.brendan/crash16.C
    trunk/gcc/testsuite/g++.old-deja/g++.law/ctors5.C
    trunk/gcc/testsuite/g++.old-deja/g++.other/crash25.C


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (17 preceding siblings ...)
  2008-07-11 16:34 ` dodji at gcc dot gnu dot org
@ 2008-07-11 16:36 ` dodji at gcc dot gnu dot org
  2008-07-11 16:37 ` dodji at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dodji at gcc dot gnu dot org @ 2008-07-11 16:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from dodji at gcc dot gnu dot org  2008-07-11 16:36 -------
(From update of attachment 15835)
This has been committed to trunk.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug other/31754] Include column number along line in error messages main.cpp:5:38
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (18 preceding siblings ...)
  2008-07-11 16:36 ` dodji at gcc dot gnu dot org
@ 2008-07-11 16:37 ` dodji at gcc dot gnu dot org
  2008-07-11 16:51 ` [Bug c++/31754] Improve column number accuracy in error messages dodji at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dodji at gcc dot gnu dot org @ 2008-07-11 16:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from dodji at gcc dot gnu dot org  2008-07-11 16:37 -------
(From update of attachment 15836)
This has been committed to trunk


-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #15836|0                           |1
        is obsolete|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug c++/31754] Improve column number accuracy in error messages
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (19 preceding siblings ...)
  2008-07-11 16:37 ` dodji at gcc dot gnu dot org
@ 2008-07-11 16:51 ` dodji at gcc dot gnu dot org
  2008-07-21 16:33 ` manu at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 26+ messages in thread
From: dodji at gcc dot gnu dot org @ 2008-07-11 16:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from dodji at gcc dot gnu dot org  2008-07-11 16:50 -------
Okay, so the two patches are now committed to trunk in changesets 
r137716 and r137721.

However, given the nature of this enhancement request, I think it will take
some on going work to have perfect column number information in the C++ front
end when using -fshow-column and eventually enabling that option by default.

I will therefore leave the bug open so that we can track the progress of this
task.

I have also changed the title of the bug to make it more generic.

Thanks for reporting this.


-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|other                       |c++
            Summary|Include column number along |Improve column number
                   |line in error messages      |accuracy in error messages
                   |main.cpp:5:38               |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug c++/31754] Improve column number accuracy in error messages
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (20 preceding siblings ...)
  2008-07-11 16:51 ` [Bug c++/31754] Improve column number accuracy in error messages dodji at gcc dot gnu dot org
@ 2008-07-21 16:33 ` manu at gcc dot gnu dot org
  2009-08-05 12:10 ` manu at gcc dot gnu dot org
  2010-02-22 17:46 ` dodji at gcc dot gnu dot org
  23 siblings, 0 replies; 26+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-07-21 16:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from manu at gcc dot gnu dot org  2008-07-21 16:32 -------
(In reply to comment #19)
> Okay, so the two patches are now committed to trunk in changesets 
> r137716 and r137721.
> 
> However, given the nature of this enhancement request, I think it will take
> some on going work to have perfect column number information in the C++ front
> end when using -fshow-column and eventually enabling that option by default.
> 

Dodji, thanks for tackling this issue. 

In the long run, all diagnostic functions should take a location parameter.
Currently there is a patch to add warning_at() by Rafael Espindola. However,
the goal is to replace warning/error/pedwarn/etc by versions that take a
location as the first parameter, thus making obsolote the use of %H. 

I see that you are adding a lot of %H to the code, so I was wondering whether
wouldn't it be better to add instead error_at, pedwarn_at and etc. In the
future it will be easier to change those to just error, pedwarn and etc, than
to change all those %H.


-- 

manu at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |manu at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug c++/31754] Improve column number accuracy in error messages
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (21 preceding siblings ...)
  2008-07-21 16:33 ` manu at gcc dot gnu dot org
@ 2009-08-05 12:10 ` manu at gcc dot gnu dot org
  2010-02-22 17:46 ` dodji at gcc dot gnu dot org
  23 siblings, 0 replies; 26+ messages in thread
From: manu at gcc dot gnu dot org @ 2009-08-05 12:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from manu at gcc dot gnu dot org  2009-08-05 12:09 -------
Are there any failing testcases for this PR? Perhaps we can turn this into a
meta-bug, or if there are no testcases right now, it would be better to close
it (we have already enough open PRs).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug c++/31754] Improve column number accuracy in error messages
  2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
                   ` (22 preceding siblings ...)
  2009-08-05 12:10 ` manu at gcc dot gnu dot org
@ 2010-02-22 17:46 ` dodji at gcc dot gnu dot org
  23 siblings, 0 replies; 26+ messages in thread
From: dodji at gcc dot gnu dot org @ 2010-02-22 17:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from dodji at gcc dot gnu dot org  2010-02-22 17:46 -------
Not working on this right now.


-- 

dodji at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|dodji at gcc dot gnu dot org|unassigned at gcc dot gnu
                   |                            |dot org
             Status|ASSIGNED                    |NEW


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [Bug c++/31754] Improve column number accuracy in error messages
       [not found] <bug-31754-4@http.gcc.gnu.org/bugzilla/>
@ 2012-04-12 21:24 ` manu at gcc dot gnu.org
  0 siblings, 0 replies; 26+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-12 21:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31754

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #23 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-12 21:23:51 UTC ---
Please open new PRs for each issue that you find. Closing this one as fixed.


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2012-04-12 21:24 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-29 12:55 [Bug other/31754] New: Include character count along line in error messages main.cpp:5:38 jg at jguk dot org
2007-04-29 15:45 ` [Bug other/31754] Include column number " pinskia at gcc dot gnu dot org
2007-10-26  5:36 ` tromey at gcc dot gnu dot org
2008-06-16 11:14 ` dseketel at redhat dot com
2008-06-16 11:15 ` dseketel at redhat dot com
2008-06-18 18:25 ` dseketel at redhat dot com
2008-06-18 19:21 ` dseketel at redhat dot com
2008-06-20  9:54 ` dseketel at redhat dot com
2008-06-20 12:05 ` dseketel at redhat dot com
2008-06-26 12:39 ` dseketel at redhat dot com
2008-06-27 21:32 ` dseketel at redhat dot com
2008-06-28  1:00 ` jg at jguk dot org
2008-06-30 17:51 ` dseketel at redhat dot com
2008-06-30 17:53 ` dseketel at redhat dot com
2008-06-30 17:55 ` dseketel at redhat dot com
2008-07-01 16:30 ` dseketel at redhat dot com
2008-07-10 14:38 ` dodji at gcc dot gnu dot org
2008-07-11 12:55 ` dodji at gcc dot gnu dot org
2008-07-11 16:34 ` dodji at gcc dot gnu dot org
2008-07-11 16:36 ` dodji at gcc dot gnu dot org
2008-07-11 16:37 ` dodji at gcc dot gnu dot org
2008-07-11 16:51 ` [Bug c++/31754] Improve column number accuracy in error messages dodji at gcc dot gnu dot org
2008-07-21 16:33 ` manu at gcc dot gnu dot org
2009-08-05 12:10 ` manu at gcc dot gnu dot org
2010-02-22 17:46 ` dodji at gcc dot gnu dot org
     [not found] <bug-31754-4@http.gcc.gnu.org/bugzilla/>
2012-04-12 21:24 ` manu at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).