re PR libstdc++/8949 (numeric_limits<>::denorm_min() and is_iec559 problems.)

2002-12-16  Paolo Carlini  <pcarlini@unitus.it>

	PR libstdc++/8949
	* include/std/std_limits.h
	(struct numeric_limits<short>,
	struct numeric_limits<unsigned short>,
	struct numeric_limits<int>,
	struct numeric_limits<unsigned int>,
	struct numeric_limits<long>,
	struct numeric_limits<unsigned long>,
	struct numeric_limits<long long>,
	struct numeric_limits<unsigned long long>): According
	to 18.2.1.2,53 and 18.2.1.5,1 is_iec559 shall be false.
	* testsuite/18_support/numeric_limits.cc: Add test04.

From-SVN: r60181
This commit is contained in:
Paolo Carlini 2002-12-16 20:52:37 +01:00 committed by Paolo Carlini
parent 165bfb59b2
commit 77bd447bb4
3 changed files with 44 additions and 8 deletions

View File

@ -1,3 +1,18 @@
2002-12-16 Paolo Carlini <pcarlini@unitus.it>
PR libstdc++/8949
* include/std/std_limits.h
(struct numeric_limits<short>,
struct numeric_limits<unsigned short>,
struct numeric_limits<int>,
struct numeric_limits<unsigned int>,
struct numeric_limits<long>,
struct numeric_limits<unsigned long>,
struct numeric_limits<long long>,
struct numeric_limits<unsigned long long>): According
to 18.2.1.2,53 and 18.2.1.5,1 is_iec559 shall be false.
* testsuite/18_support/numeric_limits.cc: Add test04.
2002-12-16 Benjamin Kosnik <bkoz@redhat.com>
* configure.in (GLIBCPP_ENABLE_DEBUG): Default to none.

View File

@ -508,7 +508,7 @@ namespace std
static short denorm_min() throw()
{ return short(); }
static const bool is_iec559 = true;
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = true;
@ -558,7 +558,7 @@ namespace std
static unsigned short denorm_min() throw()
{ return static_cast<unsigned short>(0); }
static const bool is_iec559 = true;
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = true;
@ -608,7 +608,7 @@ namespace std
static int denorm_min() throw()
{ return static_cast<int>(0); }
static const bool is_iec559 = true;
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = true;
@ -658,7 +658,7 @@ namespace std
static unsigned int denorm_min() throw()
{ return static_cast<unsigned int>(0); }
static const bool is_iec559 = true;
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = true;
@ -708,7 +708,7 @@ namespace std
static long denorm_min() throw()
{ return static_cast<long>(0); }
static const bool is_iec559 = true;
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = true;
@ -758,7 +758,7 @@ namespace std
static unsigned long denorm_min() throw()
{ return static_cast<unsigned long>(0); }
static const bool is_iec559 = true;
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = true;
@ -808,7 +808,7 @@ namespace std
static long long denorm_min() throw()
{ return static_cast<long long>(0); }
static const bool is_iec559 = true;
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = true;
@ -858,7 +858,7 @@ namespace std
static unsigned long long denorm_min() throw()
{ return static_cast<unsigned long long>(0); }
static const bool is_iec559 = true;
static const bool is_iec559 = false;
static const bool is_bounded = true;
static const bool is_modulo = true;

View File

@ -289,12 +289,33 @@ bool test03()
return test;
}
// libstdc++/8949
bool test04()
{
bool test = true;
VERIFY( !std::numeric_limits<short>::is_iec559 );
VERIFY( !std::numeric_limits<unsigned short>::is_iec559 );
VERIFY( !std::numeric_limits<int>::is_iec559 );
VERIFY( !std::numeric_limits<unsigned int>::is_iec559 );
VERIFY( !std::numeric_limits<long>::is_iec559 );
VERIFY( !std::numeric_limits<unsigned long>::is_iec559 );
VERIFY( !std::numeric_limits<long long>::is_iec559 );
VERIFY( !std::numeric_limits<unsigned long long>::is_iec559 );
#ifdef DEBUG_ASSERT
assert(test);
#endif
return test;
}
int main()
{
test01();
test02();
test03();
test04();
test_extrema<char>();
test_extrema<signed char>();