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: 19 May 2005 23:31:41 -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-19 23:31 -------
Subject: Re: Loses temporary in complex expression
"pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| ------- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-19 23:19 -------
| (In reply to comment #4)
| > but apparently the warning logic overlooks the same problem when returning
| > arguments.
|
| Actually it cannot know and here is why,
Andrew --
Please, be less hastly when analyzing PRs. If you look through the
claims, some of them are valid.
| take the following example:
| template<class T> const
| T& operator |(T t1, const T& t2) { return t1 |= t2; }
|
| struct f{ f &operator|=(const f&);};
| f i;
| f j;
|
| f h = i | j;
|
| We call |= which it self returns a reference so there is no way to
| the compiler to know it is actually returning a local variable or
| not.
Yes, but not all cases fall under that complication. Simple cases
should be handled. Please reopen this PR.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21672