public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67445] New: New warning: returning std::initializer_list bound to temporary
@ 2015-09-03 21:57 redi at gcc dot gnu.org
  0 siblings, 0 replies; only message in thread
From: redi at gcc dot gnu.org @ 2015-09-03 21:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67445

            Bug ID: 67445
           Summary: New warning: returning std::initializer_list bound to
                    temporary
           Product: gcc
           Version: 4.9.4
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

It would be useful if -Wreturn-local-addr warned for the following:

std::initializer_list<int> f() {
  return { 1, 2, 3};
}

This creates a temporary array, then returns a std::initializer_list containing
a dangling pointer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-09-03 21:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-03 21:57 [Bug c++/67445] New: New warning: returning std::initializer_list bound to temporary 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).