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

2005-05-19 Thread gdr at integrable-solutions dot net
--- Additional Comments From gdr at integrable-solutions dot net 2005-05-20 00:15 --- Subject: Re: Loses temporary in complex expression "pinskia at gcc dot gnu dot org" <[EMAIL PROTECTED]> writes: | (In reply to comment #9) | > And we can construct more. But it does not rule out the

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

2005-05-19 Thread gdr at integrable-solutions dot net
--- 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" <[EMAIL PROTECTED]> writes: | In particular, once you get all the template armwaving out of it: | | int& foo(int i) {

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

2005-05-19 Thread igodard at pacbell dot net
--- Additional Comments From igodard at pacbell dot net 2005-05-19 23:54 --- So the bug should be changed to "valid, verified, already fixed, won't back port"? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21672

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

2005-05-19 Thread pinskia at gcc dot gnu dot org
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-19 23:46 --- (In reply to comment #12) > In particular, once you get all the template armwaving out of it: > > int& foo(int i) { return i; } > > should warn and does not. The following example does not warn before 4.0

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

2005-05-19 Thread igodard at pacbell dot net
--- Additional Comments From igodard at pacbell dot net 2005-05-19 23:42 --- In particular, once you get all the template armwaving out of it: int& foo(int i) { return i; } should warn and does not. -- What|Removed |Added ---

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

2005-05-19 Thread pinskia at gcc dot gnu dot org
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-19 23:42 --- (In reply to comment #9) > And we can construct more. But it does not rule out the fact that we > should handle the simple cases. Also if you read comment #4, the simple cases are already handled. -- h

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

2005-05-19 Thread pinskia at gcc dot gnu dot org
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-19 23:40 --- (In reply to comment #9) > And we can construct more. But it does not rule out the fact that we > should handle the simple cases. What assuming |= returns *this, that is just wrong and you know it, if the

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

2005-05-19 Thread gdr at integrable-solutions dot net
--- Additional Comments From gdr at integrable-solutions dot net 2005-05-19 23:35 --- Subject: Re: Loses temporary in complex expression "pinskia at gcc dot gnu dot org" <[EMAIL PROTECTED]> writes: | Here is another example where we don't know for sure it shows how the compiler uses

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

2005-05-19 Thread gdr at integrable-solutions dot net
--- 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" <[EMAIL PROTECTED]> writes: | --- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-19 23:19 --

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

2005-05-19 Thread gdr at integrable-solutions dot net
--- Additional Comments From gdr at integrable-solutions dot net 2005-05-19 23:27 --- Subject: Re: Loses temporary in complex expression "igodard at pacbell dot net" <[EMAIL PROTECTED]> writes: | Yes, the friend function is returning a reference to its own argument, though | that seem

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

2005-05-19 Thread pinskia at gcc dot gnu dot org
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-19 23:21 --- Here is another example where we don't know for sure it shows how the compiler uses operators in C++: template const T& g(T t1, const T& t2) { return t1.h(t2); } struct f{ f &h(const f&);}; f i; f j; f

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

2005-05-19 Thread pinskia at gcc dot gnu dot org
--- 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, take the following example: template const T& ope

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

2005-05-19 Thread igodard at pacbell dot net
--- Additional Comments From igodard at pacbell dot net 2005-05-19 23:11 --- Yes, the friend function is returning a reference to its own argument, though that seems to disappear as the body gets inlined in *most* cases :-) So please reopen this as a "missing warning" bug. In most cases

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

2005-05-19 Thread pinskia at gcc dot gnu dot org
--- Additional Comments From pinskia at gcc dot gnu dot org 2005-05-19 22:56 --- Not a bug because: friend const T& operator |(T t1, const T& t2) { return t1 |= t2; } is being invoked, this comes from: template class logicalMixin { -- What|Removed

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

2005-05-19 Thread igodard at pacbell dot net
--- Additional Comments From igodard at pacbell dot net 2005-05-19 21:22 --- Created an attachment (id=8932) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8932&action=view) source code (compressed) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21672

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

2005-05-19 Thread igodard at pacbell dot net
--- Additional Comments From igodard at pacbell dot net 2005-05-19 21:22 --- Created an attachment (id=8931) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=8931&action=view) compiler output -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21672