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 libstdc++/51667] [4.7 Regression] new FAIL: 27_io/basic_*stream/* execution test with -m32


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

--- Comment #3 from Uros Bizjak <ubizjak at gmail dot com> 2011-12-24 08:00:38 UTC ---
Following testcase shows the problem in libstdc++:

--cut here--
#include <iostream>
#include <sstream>
#include <cassert>

void test01()
{
  using namespace std;

  stringstream ostr1;

  ostr1.setf(ios_base::oct);
  ostr1.setf(ios_base::hex);

  short s = -1;
  ostr1 << s;

  cout << "result: " << ostr1.str() << endl;

  assert( ostr1.str() == "-1" );
}

int main()
{
  test01();
  return 0;
}
--cut here--

[uros@localhost test]$ ./a.out
result: 65535
a.out: 7.cc:19: void test01(): Assertion `ostr1.str() == "-1"' failed.
Aborted

Sign-extension from short is missing somewhere.


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