* [Bug c++/59950] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
@ 2014-01-26 21:52 ` richard-gccbugzilla at metafoo dot co.uk
2015-03-19 10:05 ` paolo.carlini at oracle dot com
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2014-01-26 21:52 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
--- Comment #1 from Richard Smith <richard-gccbugzilla at metafoo dot co.uk> ---
Additional clarification was requested: "Foo() = Foo()" means
"Foo().operator=(Foo())". The 'operator=' has return type 'Foo&', thus that
expression is not a temporary.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
2014-01-26 21:52 ` [Bug c++/59950] " richard-gccbugzilla at metafoo dot co.uk
@ 2015-03-19 10:05 ` paolo.carlini at oracle dot com
2021-12-02 4:47 ` [Bug c++/59950] [9/10/11/12 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class pinskia at gcc dot gnu.org
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-03-19 10:05 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-03-19
Ever confirmed|0 |1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9/10/11/12 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
2014-01-26 21:52 ` [Bug c++/59950] " richard-gccbugzilla at metafoo dot co.uk
2015-03-19 10:05 ` paolo.carlini at oracle dot com
@ 2021-12-02 4:47 ` pinskia at gcc dot gnu.org
2021-12-02 4:59 ` pinskia at gcc dot gnu.org
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-02 4:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #2)
> The current top of 6.0 trunk still issues the bogus diagnostic. Confirming
> also with prior versions.
Note this example is different as it worked in 4.6.4 but the first example
failed in 4.6.4.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9/10/11/12 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
` (2 preceding siblings ...)
2021-12-02 4:47 ` [Bug c++/59950] [9/10/11/12 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class pinskia at gcc dot gnu.org
@ 2021-12-02 4:59 ` pinskia at gcc dot gnu.org
2021-12-02 5:04 ` pinskia at gcc dot gnu.org
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-02 4:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #2)
> The current top of 6.0 trunk still issues the bogus diagnostic. Confirming
> also with prior versions.
Actually this example is invalid code as DR 1312 (which was recorded as PR
79832, see that bug for it was fixed in GCC 9+).
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9/10/11/12 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
` (3 preceding siblings ...)
2021-12-02 4:59 ` pinskia at gcc dot gnu.org
@ 2021-12-02 5:04 ` pinskia at gcc dot gnu.org
2022-01-24 4:45 ` jason at gcc dot gnu.org
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-02 5:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |9.5
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9/10/11/12 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
` (4 preceding siblings ...)
2021-12-02 5:04 ` pinskia at gcc dot gnu.org
@ 2022-01-24 4:45 ` jason at gcc dot gnu.org
2022-01-25 19:28 ` cvs-commit at gcc dot gnu.org
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2022-01-24 4:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
Status|NEW |ASSIGNED
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9/10/11/12 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
` (5 preceding siblings ...)
2022-01-24 4:45 ` jason at gcc dot gnu.org
@ 2022-01-25 19:28 ` cvs-commit at gcc dot gnu.org
2022-01-25 19:32 ` [Bug c++/59950] [9/10/11 " jason at gcc dot gnu.org
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-25 19:28 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:
https://gcc.gnu.org/g:fe5cee6f62a0b229d9d51616b7490331d39b5ddd
commit r12-6862-gfe5cee6f62a0b229d9d51616b7490331d39b5ddd
Author: Jason Merrill <jason@redhat.com>
Date: Mon Jan 24 00:01:40 2022 -0500
c++: assignment to temporary [PR59950]
Given build_this of a TARGET_EXPR, cp_build_fold_indirect_ref returns the
TARGET_EXPR. But that's the wrong value category for the result of the
defaulted class assignment operator, which returns an lvalue, so we need to
actually build the INDIRECT_REF.
PR c++/59950
gcc/cp/ChangeLog:
* call.cc (build_over_call): Use cp_build_indirect_ref.
gcc/testsuite/ChangeLog:
* g++.dg/init/assign2.C: New test.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9/10/11 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
` (6 preceding siblings ...)
2022-01-25 19:28 ` cvs-commit at gcc dot gnu.org
@ 2022-01-25 19:32 ` jason at gcc dot gnu.org
2022-03-18 13:32 ` ppalka at gcc dot gnu.org
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2022-01-25 19:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11/12 Regression] |[9/10/11 Regression] Bogus
|Bogus diagnostic "taking |diagnostic "taking address
|address of temporary" |of temporary" taking
|taking address of trivial |address of trivial no-op
|no-op assignment to |assignment to temporary
|temporary with empty class |with empty class
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for GCC 12 so far.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9/10/11 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
` (7 preceding siblings ...)
2022-01-25 19:32 ` [Bug c++/59950] [9/10/11 " jason at gcc dot gnu.org
@ 2022-03-18 13:32 ` ppalka at gcc dot gnu.org
2022-03-22 5:18 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-03-18 13:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |aschepler at gmail dot com
--- Comment #7 from Patrick Palka <ppalka at gcc dot gnu.org> ---
*** Bug 54319 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9/10/11 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
` (8 preceding siblings ...)
2022-03-18 13:32 ` ppalka at gcc dot gnu.org
@ 2022-03-22 5:18 ` cvs-commit at gcc dot gnu.org
2022-03-26 23:27 ` [Bug c++/59950] [9/10 " jason at gcc dot gnu.org
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-22 5:18 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:
https://gcc.gnu.org/g:cb123480984d49c6a6e81b026633fc8ffff7883e
commit r11-9681-gcb123480984d49c6a6e81b026633fc8ffff7883e
Author: Jason Merrill <jason@redhat.com>
Date: Mon Jan 24 00:01:40 2022 -0500
c++: assignment to temporary [PR59950]
Given build_this of a TARGET_EXPR, cp_build_fold_indirect_ref returns the
TARGET_EXPR. But that's the wrong value category for the result of the
defaulted class assignment operator, which returns an lvalue, so we need to
actually build the INDIRECT_REF.
PR c++/59950
gcc/cp/ChangeLog:
* call.c (build_over_call): Use cp_build_indirect_ref.
gcc/testsuite/ChangeLog:
* g++.dg/init/assign2.C: New test.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9/10 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
` (9 preceding siblings ...)
2022-03-22 5:18 ` cvs-commit at gcc dot gnu.org
@ 2022-03-26 23:27 ` jason at gcc dot gnu.org
2022-05-12 21:15 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2022-03-26 23:27 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[9/10/11 Regression] Bogus |[9/10 Regression] Bogus
|diagnostic "taking address |diagnostic "taking address
|of temporary" taking |of temporary" taking
|address of trivial no-op |address of trivial no-op
|assignment to temporary |assignment to temporary
|with empty class |with empty class
--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> ---
And 11.3
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9/10 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
` (10 preceding siblings ...)
2022-03-26 23:27 ` [Bug c++/59950] [9/10 " jason at gcc dot gnu.org
@ 2022-05-12 21:15 ` cvs-commit at gcc dot gnu.org
2022-05-13 17:41 ` [Bug c++/59950] [9 " cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-12 21:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:
https://gcc.gnu.org/g:080e737a851d57697d0aac55749296c5c454c421
commit r10-10723-g080e737a851d57697d0aac55749296c5c454c421
Author: Jason Merrill <jason@redhat.com>
Date: Mon Jan 24 00:01:40 2022 -0500
c++: assignment to temporary [PR59950]
Given build_this of a TARGET_EXPR, cp_build_fold_indirect_ref returns the
TARGET_EXPR. But that's the wrong value category for the result of the
defaulted class assignment operator, which returns an lvalue, so we need to
actually build the INDIRECT_REF.
PR c++/59950
gcc/cp/ChangeLog:
* call.c (build_over_call): Use cp_build_indirect_ref.
gcc/testsuite/ChangeLog:
* g++.dg/init/assign2.C: New test.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
` (11 preceding siblings ...)
2022-05-12 21:15 ` cvs-commit at gcc dot gnu.org
@ 2022-05-13 17:41 ` cvs-commit at gcc dot gnu.org
2022-05-13 17:49 ` jason at gcc dot gnu.org
2022-07-31 8:50 ` redi at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-13 17:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:
https://gcc.gnu.org/g:3daf541e8fe2dd0807a3dd49a9b8c065d7d46731
commit r9-10170-g3daf541e8fe2dd0807a3dd49a9b8c065d7d46731
Author: Jason Merrill <jason@redhat.com>
Date: Mon Jan 24 00:01:40 2022 -0500
c++: assignment to temporary [PR59950]
Given build_this of a TARGET_EXPR, cp_build_fold_indirect_ref returns the
TARGET_EXPR. But that's the wrong value category for the result of the
defaulted class assignment operator, which returns an lvalue, so we need to
actually build the INDIRECT_REF.
PR c++/59950
gcc/cp/ChangeLog:
* call.c (build_over_call): Use cp_build_indirect_ref.
gcc/testsuite/ChangeLog:
* g++.dg/init/assign2.C: New test.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
` (12 preceding siblings ...)
2022-05-13 17:41 ` [Bug c++/59950] [9 " cvs-commit at gcc dot gnu.org
@ 2022-05-13 17:49 ` jason at gcc dot gnu.org
2022-07-31 8:50 ` redi at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: jason at gcc dot gnu.org @ 2022-05-13 17:49 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #12 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 9.5/10.4/11.3/12.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug c++/59950] [9 Regression] Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary with empty class
2014-01-26 19:40 [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary richard-gccbugzilla at metafoo dot co.uk
` (13 preceding siblings ...)
2022-05-13 17:49 ` jason at gcc dot gnu.org
@ 2022-07-31 8:50 ` redi at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: redi at gcc dot gnu.org @ 2022-07-31 8:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jlame646 at gmail dot com
--- Comment #13 from Jonathan Wakely <redi at gcc dot gnu.org> ---
*** Bug 106489 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 16+ messages in thread