This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21672] Loses temporary in complex expression
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 May 2005 00:12:44 -0000
- Subject: [Bug c++/21672] Loses temporary in complex expression
- References: <20050519212022.21672.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2005-05-20 00:12 -------
Subject: Re: Loses temporary in complex expression
"igodard at pacbell dot net" <gcc-bugzilla@gcc.gnu.org> writes:
| In particular, once you get all the template armwaving out of it:
|
| int& foo(int i) { return i; }
|
| should warn and does not.
It does with my compiler:
% cat a.C && g++ -c -Wall a.C
int& f(int i)
{
return i;
}
a.C: In function 'int& f(int)':
a.C:2: warning: reference to local variable 'i' returned
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21672