This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[v3] libstdc++/37624
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 23 Sep 2008 19:13:47 +0200
- Subject: [v3] libstdc++/37624
Hi,
sanity checked x86_64-linux, committed to mainline.
Paolo.
////////////////////
2008-09-23 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/37624
* testsuite/22_locale/num_get/get/char/10.cc: Skip long double case
when strtold is not available.
* testsuite/22_locale/num_get/get/wchar_t/10.cc: Likewise.
Index: 22_locale/num_get/get/wchar_t/10.cc
===================================================================
*** 22_locale/num_get/get/wchar_t/10.cc (revision 140580)
--- 22_locale/num_get/get/wchar_t/10.cc (working copy)
*************** void test01()
*** 35,46 ****
const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc());
ios_base::iostate err = ios_base::goodbit;
iterator_type end;
! float f = 0.0f;
! double d = 0.0;
! long double ld = 0.0l;
! float f1 = 1.0f;
! double d1 = 3.0;
! long double ld1 = 6.0l;
iss.str(L"1e.");
err = ios_base::goodbit;
--- 35,43 ----
const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc());
ios_base::iostate err = ios_base::goodbit;
iterator_type end;
! float f = 1.0f;
! double d = 1.0;
! long double ld = 1.0l;
iss.str(L"1e.");
err = ios_base::goodbit;
*************** void test01()
*** 60,68 ****
iss.clear();
err = ios_base::goodbit;
end = ng.get(iss.rdbuf(), 0, iss, err, ld);
- VERIFY( err == ios_base::failbit );
VERIFY( *end == L' ' );
VERIFY( ld == 0.0l );
}
int main()
--- 57,70 ----
iss.clear();
err = ios_base::goodbit;
end = ng.get(iss.rdbuf(), 0, iss, err, ld);
VERIFY( *end == L' ' );
+
+ // libstdc++/37624. We can't always obtain the required behavior
+ // when sscanf is involved, because of, e.g., glibc/1765.
+ #if defined(_GLIBCXX_HAVE_STRTOLD) && !defined(_GLIBCXX_HAVE_BROKEN_STRTOLD)
+ VERIFY( err == ios_base::failbit );
VERIFY( ld == 0.0l );
+ #endif
}
int main()
Index: 22_locale/num_get/get/char/10.cc
===================================================================
*** 22_locale/num_get/get/char/10.cc (revision 140580)
--- 22_locale/num_get/get/char/10.cc (working copy)
*************** void test01()
*** 35,47 ****
const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc());
ios_base::iostate err = ios_base::goodbit;
iterator_type end;
! float f = 0.0f;
! double d = 0.0;
! long double ld = 0.0l;
! float f1 = 1.0f;
! double d1 = 3.0;
! long double ld1 = 6.0l;
!
iss.str("1e.");
err = ios_base::goodbit;
end = ng.get(iss.rdbuf(), 0, iss, err, f);
--- 35,44 ----
const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc());
ios_base::iostate err = ios_base::goodbit;
iterator_type end;
! float f = 1.0f;
! double d = 1.0;
! long double ld = 1.0l;
!
iss.str("1e.");
err = ios_base::goodbit;
end = ng.get(iss.rdbuf(), 0, iss, err, f);
*************** void test01()
*** 60,68 ****
iss.clear();
err = ios_base::goodbit;
end = ng.get(iss.rdbuf(), 0, iss, err, ld);
- VERIFY( err == ios_base::failbit );
VERIFY( *end == ' ' );
VERIFY( ld == 0.0l );
}
int main()
--- 57,70 ----
iss.clear();
err = ios_base::goodbit;
end = ng.get(iss.rdbuf(), 0, iss, err, ld);
VERIFY( *end == ' ' );
+
+ // libstdc++/37624. We can't always obtain the required behavior
+ // when sscanf is involved, because of, e.g., glibc/1765.
+ #if defined(_GLIBCXX_HAVE_STRTOLD) && !defined(_GLIBCXX_HAVE_BROKEN_STRTOLD)
+ VERIFY( err == ios_base::failbit );
VERIFY( ld == 0.0l );
+ #endif
}
int main()