public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48562] New: Prematurely destroys initializer_list array when using new-expression
@ 2011-04-11 21:45 schaub.johannes at googlemail dot com
  2011-04-19  9:20 ` [Bug c++/48562] " amonakov at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: schaub.johannes at googlemail dot com @ 2011-04-11 21:45 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Prematurely destroys initializer_list array when using
                    new-expression
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: schaub.johannes@googlemail.com


The C++0x spec requires that GCC destroys the backing-up array at "delete p",
but GCC appears to destroy it immediately after the first declaration (as
checked by using a class type that has a side-effecting destructor). 

    auto *p= new initializer_list<int>{1, 2, 3}; 
    { auto q(*p); }
    delete p;


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

end of thread, other threads:[~2011-09-25 14:39 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-11 21:45 [Bug c++/48562] New: Prematurely destroys initializer_list array when using new-expression schaub.johannes at googlemail dot com
2011-04-19  9:20 ` [Bug c++/48562] " amonakov at gcc dot gnu.org
2011-09-23 22:09 ` [Bug c++/48562] [C++0x] " paolo.carlini at oracle dot com
2011-09-23 22:25 ` [Bug c++/48562] [C++0x] warn about uses of initializer_list that will lead to dangling pointers jason at gcc dot gnu.org
2011-09-23 22:26 ` paolo.carlini at oracle dot com
2011-09-23 22:35 ` paolo.carlini at oracle dot com
2011-09-25 11:08 ` paolo.carlini at oracle dot com
2011-09-25 14:53 ` schaub.johannes at googlemail dot com
2011-09-25 14:58 ` paolo.carlini at oracle dot com

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).