public inbox for overseers@sourceware.org
 help / color / mirror / Atom feed
* Fwd: I found a bug, STL memory alloc
       [not found] <CAAwLaKWGUrFVU96ZVAz-fFwufdiO4ezOjT=iRg1X1o2Fe38jSw@mail.gmail.com>
@ 2014-12-21 16:30 ` Li Zhaojia
  0 siblings, 0 replies; only message in thread
From: Li Zhaojia @ 2014-12-21 16:30 UTC (permalink / raw)
  To: overseers

---------- Forwarded message ----------
From: Li Zhaojia <waterlzj@gmail.com>
Date: 2014-12-21 2:17 GMT+08:00
Subject: I found a bug, STL memory alloc
To: overseers@gcc.gnu.org


#include <future>
#include <iostream>
#include <string>

using std::cout;
using std::endl;

int main()
{
    try
    {
        std::future<int> f;
        f.get();
    }
    catch(const std::future_error& ex)
    {
        auto what1 = ex.what();

        std::string str="123";
        str.reserve(20);

        if(str.data() == what1)
            cout << "impossible" << endl;
    }
}

--------------------------
this program print:

impossible

but it should print nothing, I have no bugzilla account, this mail is
all I can do;


and, forgive me poor english

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

only message in thread, other threads:[~2014-12-20 18:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CAAwLaKWGUrFVU96ZVAz-fFwufdiO4ezOjT=iRg1X1o2Fe38jSw@mail.gmail.com>
2014-12-21 16:30 ` Fwd: I found a bug, STL memory alloc Li Zhaojia

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