This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/51667] [4.7 Regression] new FAIL: 27_io/basic_*stream/* execution test with -m32
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 24 Dec 2011 08:00:38 +0000
- Subject: [Bug libstdc++/51667] [4.7 Regression] new FAIL: 27_io/basic_*stream/* execution test with -m32
- Auto-submitted: auto-generated
- References: <bug-51667-4@http.gcc.gnu.org/bugzilla/>
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.