This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/59267] gcc 4.8.2 optimizes code with side-effects away


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

--- Comment #3 from James <troomps01 at gmail dot com> ---
Sorry about having a second comment in a row, but I was playing a bit more with
this, and using a string stream as solely an output stream doesn't appear to
update the stream pointer after outputting the value (shouldn't this also
output a blank string for os?):

#include <iostream>
#include <sstream>

using namespace std;

int main(void)
{
    stringstream os("");
    double val = 3.14159;
    os << val;
    cout << "Value: " << val << ", out stream: " << os.str() << endl;
    return 0;
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]