public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59950] New: Bogus diagnostic "taking address of temporary" taking address of trivial no-op assignment to temporary
@ 2014-01-26 19:40 richard-gccbugzilla at metafoo dot co.uk
  2014-01-26 21:52 ` [Bug c++/59950] " richard-gccbugzilla at metafoo dot co.uk
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: richard-gccbugzilla at metafoo dot co.uk @ 2014-01-26 19:40 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59950

            Bug ID: 59950
           Summary: Bogus diagnostic "taking address of temporary" taking
                    address of trivial no-op assignment to temporary
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard-gccbugzilla at metafoo dot co.uk

GCC rejects this valid code:

 struct Foo {};
 int f(Foo *p);
 int n = f(&(Foo() = Foo()));

... saying ...

<stdin>:3:27: error: taking address of temporary [-fpermissive]

The incorrect diagnostic only appears if 'Foo' is empty and its assignment
operator is defaulted. (Maybe the assignment is getting folded away before the
check is performed?)

Google ref b/12744615


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-07-31  8:50 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
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
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
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
2022-05-13 17:49 ` jason at gcc dot gnu.org
2022-07-31  8:50 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).