This is the mail archive of the gcc@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++ extension "cast-as-lvalues": time to deprecate?


On Fri, May 09, 2003 at 08:54:25AM +0200, Gabriel Dos Reis wrote:
> This extension is an examplar of extensions that were not given enough
> thought and are causing much more trouble than they do useful things.
> This extension in particular is not needed nor useful in C++ because
> they are far better alternatives.  It is pointless. 
> It should simply be removed.

As it has already been deprecated, I agree that it should be removed.
Because of bad interactions with references, its presence can cause severe
problems; in particular, it can cause the wrong overloaded function in a
conforming C++ program to be chosen.  Since it's likely that a non-const
function will be chosen instead of a const function, severe things can
happen, like code attempting to change a literal in a read-only section,
giving a program crash.


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