This is the mail archive of the gcc-bugs@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]

[Bug c++/21672] Loses temporary in complex expression


------- 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


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