This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
C++ extension "cast-as-lvalues": time to deprecate?
- From: "Giovanni Bajo" <giovannibajo at libero dot it>
- To: <gcc at gcc dot gnu dot org>
- Cc: "Giovanni Bajo" <giovannibajo at libero dot it>
- Date: Fri, 9 May 2003 01:54:00 +0200
- Subject: C++ extension "cast-as-lvalues": time to deprecate?
Hello,
GCC implements an extension which lets cast result be a lvalue instead of a
rvalue, as would be prescribed by the standard. There are several open PRs
about problems with this extension, some of which are very tricky and
involves also wrong-code problems (together with inliner, for instance).
Just for reference, you may want to check:
http://gcc.gnu.org/PR?1833
http://gcc.gnu.org/PR?1920
http://gcc.gnu.org/PR?7503
http://gcc.gnu.org/PR?7884
Other PRs have been closed already as duplicates.
I think there are no doubts that this extension causes confusion among
users, because the behaviour is not expected. Plus, bugs in its
implementation causes very bad side effects. If this was not enough, the
extension is active even in -ansi -pedantic mode, which is counter intuive
and confusing. Since GCC already deprecated and removed less evil extensions
like implicit typename, I wonder if maybe it's time to deprecate this
"cast-as-lvalue" and remove it as soon as possible.
Giovanni Bajo