This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/2350: No warning for referencing a temporary
- From: rth at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, hankinsr at umich dot edu, nobody at gcc dot gnu dot org
- Date: 2 Apr 2002 07:58:07 -0000
- Subject: Re: c++/2350: No warning for referencing a temporary
- Reply-to: rth at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, hankinsr at umich dot edu, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Old Synopsis: constant propagation problem accross function call
New Synopsis: No warning for referencing a temporary
State-Changed-From-To: open->analyzed
State-Changed-By: rth
State-Changed-When: Mon Apr 1 23:58:06 2002
State-Changed-Why:
Not a bug. The cast converts your lvalue to an rvalue, which
leads you referencing a temporary rather than the variable
that you intended.
It would be Really Nice if -Wall would diagnose this, so I'm
leaving the PR open, and re-categorizing it.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=2350