[Bug other/31754] Include column number along line in error messages main.cpp:5:38

2008-06-16 Thread dseketel at redhat dot com


--- 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



[Bug other/31754] Include column number along line in error messages main.cpp:5:38

2008-06-16 Thread dseketel at redhat dot com


--- 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



[Bug other/31754] Include column number along line in error messages main.cpp:5:38

2008-06-18 Thread dseketel at redhat dot com


--- 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



[Bug other/31754] Include column number along line in error messages main.cpp:5:38

2008-06-18 Thread dseketel at redhat dot com


--- 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



[Bug other/31754] Include column number along line in error messages main.cpp:5:38

2008-06-20 Thread dseketel at redhat dot com


--- 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



[Bug other/31754] Include column number along line in error messages main.cpp:5:38

2008-06-20 Thread dseketel at redhat dot com


--- 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



[Bug other/31754] Include column number along line in error messages main.cpp:5:38

2008-06-26 Thread dseketel at redhat dot com


--- 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



[Bug other/31754] Include column number along line in error messages main.cpp:5:38

2008-06-27 Thread dseketel at redhat dot com


--- 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



[Bug other/31754] Include column number along line in error messages main.cpp:5:38

2008-06-30 Thread dseketel at redhat dot com


--- 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



[Bug other/31754] Include column number along line in error messages main.cpp:5:38

2008-06-30 Thread dseketel at redhat dot com


--- 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



[Bug other/31754] Include column number along line in error messages main.cpp:5:38

2008-06-30 Thread dseketel at redhat dot com


--- 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



[Bug other/31754] Include column number along line in error messages main.cpp:5:38

2008-07-01 Thread dseketel at redhat dot com


--- 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



[Bug c++/36696] Default constructor instance definition with empty argument list quietly ignored

2008-07-02 Thread dseketel at redhat dot com


--- Comment #2 from dseketel at redhat dot com  2008-07-02 21:09 ---
Yes, foo bar (); is indeed the declaration of a function bar of type foo that
takes no arguments in parameter.

I believe gcc is right there.


-- 

dseketel at redhat dot com changed:

   What|Removed |Added

 CC||dseketel at redhat dot com


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



[Bug c++/13101] incorrect warning on initialized extern const function pointer

2008-07-02 Thread dseketel at redhat dot com


--- Comment #2 from dseketel at redhat dot com  2008-07-02 22:19 ---
Hello,

I have sent a patch to the list at
http://gcc.gnu.org/ml/gcc-patches/2008-07/msg00160.html.

Hopefully that patch should fix this issue.


-- 

dseketel at redhat dot com changed:

   What|Removed |Added

 CC||dseketel at redhat dot com


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



[Bug c++/13699] Extern "C" routine in different namespaces accepted with different exception signature

2008-07-07 Thread dseketel at redhat dot com


--- Comment #3 from dseketel at redhat dot com  2008-07-07 14:54 ---
Created an attachment (id=15871)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15871&action=view)
first attempt at trying to fix the bug

This patch checks that re-declaration of extern "C" functions complies with the
exception specification constraints.


-- 


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



[Bug c++/13699] Extern "C" routine in different namespaces accepted with different exception signature

2008-07-08 Thread dseketel at redhat dot com


--- Comment #4 from dseketel at redhat dot com  2008-07-08 17:58 ---
Created an attachment (id=15876)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15876&action=view)
display warnings instead of error

Second opus of the patch.

It appears that the patch makes g++ not capable of compiling libstdc++
precisely because libstdc++ contains re-declarations of functions with C
linkage specification, without respecting the exception specification
constraints.

Therefore, the we now report warnings instead of errors. Errors can be
triggered using -pedantic though.

The patch has been regtested on x86.


-- 

dseketel at redhat dot com changed:

   What|Removed |Added

  Attachment #15871|0   |1
is obsolete||


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