This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH: PRs 10147, 12337, 12344, 12236, 8656


On Tue, 2003-10-07 at 02:02, Gabriel Dos Reis wrote:
> Mark Mitchell <mark@codesourcery.com> writes:
> 
> | This patch, tested on i686-pc-linux-gnu, fixes the above named PRs.
> | 
> | PR c++/10147 was a confusing error message problem.  Basically, most
> | uses of "%E" in the C++ front end should be removed;
> 
> I'm of the opposite opinion.  Certain things are expressions and
> should be displayed as expressions. 

In the abstract, yes.  But, until the front end has a separate lowering
pass, it will always be a mistake to use "%E".  Every use will
eventually result in a bug report of the form "The compiler says
something about __vtbl" or something similar.

It's unwise to use a feature known to create confusion in error
messages, whose primary purpose is to prevent confusion!

Other compilers have this problem too -- and they cleverly avoid
printing whole expressions.  They use column-numbers (or carets) as a
way of indicating the expression.

> | 	PR c++/10147
> | 	* call.c (initialize_reference): Tweak error message.
> | 	* cxx-pretty-print.h (cxx_pretty_printer_flags): Remove
> | 	pp_cxx_flag_qualified_id and pp_cxx_flag_global_scope.
> 
> I object to this removal.  The bug fix does not need their removal.
> The pretty-printer can be used in other context where those flags are
> useful.  For error messages, it should be sufficient to set the flag
> to undoncitionaly print scopes. 

Go ahead and undo that part of the patch and reimplement it as you
like.  But, those flags were never set anywhere in the front end, so the
change I made had no negative effect on current behavior.

-- 
Mark Mitchell <mark@codesourcery.com>
CodeSourcery, LLC


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]