--- 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
--- 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) {
--- 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
--- 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
--- 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
---
--- 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
--- 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
--- 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
--- 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 --
--- 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
--- 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
--- 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
--- 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
--- 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
--- 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
--- 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
16 matches
Mail list logo