* testsuite/25_algorithms/nth_element/2.cc: Avoid -Wall warnings.
* testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc: Likewise.
* testsuite/27_io/basic_streambuf/sgetc/char/1.cc: Likewise.
* testsuite/27_io/basic_stringbuf/sgetn/wchar_t/1.cc: Likewise.
* testsuite/27_io/basic_stringbuf/sgetn/char/1.cc: Likewise.
* testsuite/27_io/basic_stringbuf/sbumpc/wchar_t/1.cc: Likewise.
* testsuite/27_io/basic_stringbuf/sbumpc/char/1.cc: Likewise.
* testsuite/27_io/basic_stringbuf/snextc/wchar_t/1.cc: Likewise.
* testsuite/27_io/basic_stringbuf/snextc/char/1.cc: Likewise.
* testsuite/27_io/basic_istream/peek/wchar_t/12296.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_character/wchar_t/
28277-2.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_character/wchar_t/
28277-3.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_character/wchar_t/
28277-4.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_character/char/
28277-3.cc: Likewise.
* testsuite/27_io/basic_ostream/inserters_character/char/
28277-4.cc: Likewise.
* testsuite/19_diagnostics/error_code/operators/bool.cc: Likewise.
* testsuite/19_diagnostics/error_code/operators/bool_neg.cc: Likewise.
* testsuite/18_support/headers/cstddef/macros.cc: Likewise.
* testsuite/21_strings/basic_string/inserters_extractors/
wchar_t/28277.cc: Likewise.
* testsuite/21_strings/basic_string/inserters_extractors/
char/28277.cc: Likewise.
* testsuite/26_numerics/headers/cmath/25913.cc: Likewise.
* testsuite/ext/pb_ds/example/priority_queue_xref.cc: Likewise.
* testsuite/ext/vstring/inserters_extractors/wchar_t/28277.cc: Likewise.
* testsuite/ext/vstring/inserters_extractors/char/28277.cc: Likewise.
* testsuite/ext/enc_filebuf/char/13598.cc: Likewise.
* testsuite/22_locale/collate/compare/char/2.cc: Likewise.
* testsuite/22_locale/time_put/put/wchar_t/5.cc: Likewise.
* testsuite/22_locale/time_put/put/char/5.cc: Likewise.
* testsuite/22_locale/time_put/put/char/6.cc: Likewise.
* testsuite/22_locale/time_put/put/char/7.cc: Likewise.
* testsuite/22_locale/time_put/put/char/8.cc: Likewise.
* testsuite/22_locale/codecvt/unshift/char/1.cc: Likewise.
* testsuite/22_locale/codecvt/length/char/1.cc: Likewise.
* testsuite/22_locale/codecvt/length/char/2.cc: Likewise.
* testsuite/22_locale/codecvt/in/wchar_t/9.cc: Likewise.
* testsuite/22_locale/codecvt/in/char/1.cc: Likewise.
* testsuite/22_locale/codecvt/out/char/1.cc: Likewise.
* testsuite/22_locale/num_get/get/wchar_t/1.cc: Likewise.
* testsuite/22_locale/num_get/get/char/1.cc: Likewise.
* testsuite/tr1/5_numerical_facilities/random/uniform_int/
33128.cc: Likewise.
* testsuite/tr1/2_general_utilities/shared_ptr/thread/
mutex_weaktoshared.cc: Likewise.
* testsuite/tr1/2_general_utilities/shared_ptr/thread/
default_weaktoshared.cc: Likewise.
* testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/
range.cc: Likewise.
* testsuite/tr1/7_regular_expressions/basic_regex/assign/char/
range.cc: Likewise.
* testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/
range.cc: Likewise.
* testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/
range.cc: Likewise.
* testsuite/23_containers/multimap/operations/1.cc: Likewise.
* testsuite/23_containers/set/operations/1.cc: Likewise.
* testsuite/23_containers/vector/bool/capacity/29134.cc: Likewise.
* testsuite/23_containers/deque/modifiers/erase/1.cc: Likewise.
* testsuite/23_containers/deque/modifiers/erase/2.cc: Likewise.
* testsuite/23_containers/multiset/operations/1.cc: Likewise.
* testsuite/23_containers/map/operations/1.cc: Likewise.
* testsuite/util/testsuite_hooks.cc: Likewise.
* testsuite/util/testsuite_rvalref.h: Likewise.
2007-12-10 Jakub Jelinek <jakub@redhat.com>
* include/ext/throw_allocator.h (print_to_string): Change sprintf
format to %lu and cast ref.second.{first,second} to long.
* include/debug/safe_iterator.tcc (_M_can_advance): Add parens to
avoid warnings.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130743
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-12-10 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/25_algorithms/nth_element/2.cc: Avoid -Wall warnings.
+ * testsuite/27_io/basic_streambuf/sgetc/wchar_t/1.cc: Likewise.
+ * testsuite/27_io/basic_streambuf/sgetc/char/1.cc: Likewise.
+ * testsuite/27_io/basic_stringbuf/sgetn/wchar_t/1.cc: Likewise.
+ * testsuite/27_io/basic_stringbuf/sgetn/char/1.cc: Likewise.
+ * testsuite/27_io/basic_stringbuf/sbumpc/wchar_t/1.cc: Likewise.
+ * testsuite/27_io/basic_stringbuf/sbumpc/char/1.cc: Likewise.
+ * testsuite/27_io/basic_stringbuf/snextc/wchar_t/1.cc: Likewise.
+ * testsuite/27_io/basic_stringbuf/snextc/char/1.cc: Likewise.
+ * testsuite/27_io/basic_istream/peek/wchar_t/12296.cc: Likewise.
+ * testsuite/27_io/basic_ostream/inserters_character/wchar_t/
+ 28277-2.cc: Likewise.
+ * testsuite/27_io/basic_ostream/inserters_character/wchar_t/
+ 28277-3.cc: Likewise.
+ * testsuite/27_io/basic_ostream/inserters_character/wchar_t/
+ 28277-4.cc: Likewise.
+ * testsuite/27_io/basic_ostream/inserters_character/char/
+ 28277-3.cc: Likewise.
+ * testsuite/27_io/basic_ostream/inserters_character/char/
+ 28277-4.cc: Likewise.
+ * testsuite/19_diagnostics/error_code/operators/bool.cc: Likewise.
+ * testsuite/19_diagnostics/error_code/operators/bool_neg.cc: Likewise.
+ * testsuite/18_support/headers/cstddef/macros.cc: Likewise.
+ * testsuite/21_strings/basic_string/inserters_extractors/
+ wchar_t/28277.cc: Likewise.
+ * testsuite/21_strings/basic_string/inserters_extractors/
+ char/28277.cc: Likewise.
+ * testsuite/26_numerics/headers/cmath/25913.cc: Likewise.
+ * testsuite/ext/pb_ds/example/priority_queue_xref.cc: Likewise.
+ * testsuite/ext/vstring/inserters_extractors/wchar_t/28277.cc: Likewise.
+ * testsuite/ext/vstring/inserters_extractors/char/28277.cc: Likewise.
+ * testsuite/ext/enc_filebuf/char/13598.cc: Likewise.
+ * testsuite/22_locale/collate/compare/char/2.cc: Likewise.
+ * testsuite/22_locale/time_put/put/wchar_t/5.cc: Likewise.
+ * testsuite/22_locale/time_put/put/char/5.cc: Likewise.
+ * testsuite/22_locale/time_put/put/char/6.cc: Likewise.
+ * testsuite/22_locale/time_put/put/char/7.cc: Likewise.
+ * testsuite/22_locale/time_put/put/char/8.cc: Likewise.
+ * testsuite/22_locale/codecvt/unshift/char/1.cc: Likewise.
+ * testsuite/22_locale/codecvt/length/char/1.cc: Likewise.
+ * testsuite/22_locale/codecvt/length/char/2.cc: Likewise.
+ * testsuite/22_locale/codecvt/in/wchar_t/9.cc: Likewise.
+ * testsuite/22_locale/codecvt/in/char/1.cc: Likewise.
+ * testsuite/22_locale/codecvt/out/char/1.cc: Likewise.
+ * testsuite/22_locale/num_get/get/wchar_t/1.cc: Likewise.
+ * testsuite/22_locale/num_get/get/char/1.cc: Likewise.
+ * testsuite/tr1/5_numerical_facilities/random/uniform_int/
+ 33128.cc: Likewise.
+ * testsuite/tr1/2_general_utilities/shared_ptr/thread/
+ mutex_weaktoshared.cc: Likewise.
+ * testsuite/tr1/2_general_utilities/shared_ptr/thread/
+ default_weaktoshared.cc: Likewise.
+ * testsuite/tr1/7_regular_expressions/basic_regex/assign/wchar_t/
+ range.cc: Likewise.
+ * testsuite/tr1/7_regular_expressions/basic_regex/assign/char/
+ range.cc: Likewise.
+ * testsuite/tr1/7_regular_expressions/basic_regex/ctors/wchar_t/
+ range.cc: Likewise.
+ * testsuite/tr1/7_regular_expressions/basic_regex/ctors/char/
+ range.cc: Likewise.
+ * testsuite/23_containers/multimap/operations/1.cc: Likewise.
+ * testsuite/23_containers/set/operations/1.cc: Likewise.
+ * testsuite/23_containers/vector/bool/capacity/29134.cc: Likewise.
+ * testsuite/23_containers/deque/modifiers/erase/1.cc: Likewise.
+ * testsuite/23_containers/deque/modifiers/erase/2.cc: Likewise.
+ * testsuite/23_containers/multiset/operations/1.cc: Likewise.
+ * testsuite/23_containers/map/operations/1.cc: Likewise.
+ * testsuite/util/testsuite_hooks.cc: Likewise.
+ * testsuite/util/testsuite_rvalref.h: Likewise.
+
+2007-12-10 Jakub Jelinek <jakub@redhat.com>
+
+ * include/ext/throw_allocator.h (print_to_string): Change sprintf
+ format to %lu and cast ref.second.{first,second} to long.
+ * include/debug/safe_iterator.tcc (_M_can_advance): Add parens to
+ avoid warnings.
+
2007-12-09 Benjamin Kosnik <bkoz@redhat.com>
* docs/html/ext/howto.html: Update.
// Debugging iterator implementation (out of line) -*- C++ -*-
-// Copyright (C) 2003, 2004, 2005, 2006
+// Copyright (C) 2003, 2004, 2005, 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
static_cast<const _Sequence*>(_M_sequence)->begin();
std::pair<difference_type, _Distance_precision> __dist =
this->_M_get_distance(__begin, *this);
- bool __ok = (__dist.second == __dp_exact && __dist.first >= -__n
- || __dist.second != __dp_exact && __dist.first > 0);
+ bool __ok = ((__dist.second == __dp_exact && __dist.first >= -__n)
+ || (__dist.second != __dp_exact && __dist.first > 0));
return __ok;
}
else
static_cast<const _Sequence*>(_M_sequence)->end();
std::pair<difference_type, _Distance_precision> __dist =
this->_M_get_distance(*this, __end);
- bool __ok = (__dist.second == __dp_exact && __dist.first >= __n
- || __dist.second != __dp_exact && __dist.first > 0);
+ bool __ok = ((__dist.second == __dp_exact && __dist.first >= __n)
+ || (__dist.second != __dp_exact && __dist.first > 0));
return __ok;
}
}
char buf[40];
const char tab('\t');
s += "address: ";
- sprintf(buf, "%p", ref.first);
+ __builtin_sprintf(buf, "%p", ref.first);
s += buf;
s += tab;
s += "label: ";
- sprintf(buf, "%u", ref.second.first);
+ unsigned long l = static_cast<unsigned long>(ref.second.first);
+ __builtin_sprintf(buf, "%lu", l);
s += buf;
s += tab;
s += "size: ";
- sprintf(buf, "%u", ref.second.second);
+ l = static_cast<unsigned long>(ref.second.second);
+ __builtin_sprintf(buf, "%lu", l);
s += buf;
s += '\n';
}
// { dg-do compile }
// 2001-02-06 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2003, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
void test02()
{
// Must not be (void*)0
- const int j = NULL;
+ const int j __attribute__((unused)) = NULL;
#ifndef NULL
#error "NULL_must_be_a_macro"
int main()
{
bool test __attribute__((unused)) = true;
- bool b;
// 1
std::error_code e1;
std::error_code e;
int i = e;
- return 0;
+ return i;
}
// { dg-error "invalid conversion" "" { target *-*-* } 29 }
// { dg-do compile }
// 2001-06-18 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2003, 2007 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
using namespace std;
// Check for required typedefs
- long l;
typedef raw_storage_iterator<long*, long> test_iterator;
typedef test_iterator::value_type value_type;
typedef test_iterator::difference_type difference_type;
// 2006-10-12 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation
+// Copyright (C) 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
oss_01 << str_01;
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == string::size_type(width) );
}
int main()
// 2006-10-12 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation
+// Copyright (C) 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
oss_01 << str_01;
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == wstring::size_type(width) );
}
int main()
bool test __attribute__((unused)) = true;
const char* c_lit = "black pearl jasmine tea";
const char* from_next;
- int size = 25;
+ int size = 23;
char* c_arr = new char[size];
char* c_ref = new char[size];
char* to_next;
r1 = cvt->in(state01, efrom, e_lit + i, efrom_next,
ito, i_arr + esize, ito_next);
- printf("%d %d %d %x %x\n", efrom - e_lit, i, efrom_next - e_lit,
- efrom[-1], ito[-1]);
-
// It it not clear if partial should ever be returned here
// (see DR 382).
VERIFY( r1 == codecvt_base::ok || r1 == codecvt_base::partial );
bool test __attribute__((unused)) = true;
const char* c_lit = "black pearl jasmine tea";
- int size = 25;
+ int size = 23;
locale loc = locale::classic();
c_codecvt::state_type state;
bool test __attribute__((unused)) = true;
const char* c_lit = "black pearl jasmine tea";
- int size = 25;
+ int size = 23;
locale loc (locale::classic(), new length_codecvt);
c_codecvt::state_type state;
bool test __attribute__((unused)) = true;
const char* c_lit = "black pearl jasmine tea";
const char* from_next;
- int size = 25;
+ int size = 23;
char* c_arr = new char[size];
char* c_ref = new char[size];
char* to_next;
bool test __attribute__((unused)) = true;
const char* c_lit = "black pearl jasmine tea";
const char* from_next;
- int size = 25;
+ int size = 23;
char* c_arr = new char[size];
char* c_ref = new char[size];
char* to_next;
// 2001-08-15 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// int compare(const charT*, const charT*, const charT*, const charT*) const
- const char* strlit1 = "monkey picked tikuanyin oolong";
const char* strlit3 = "Äuglein Augment"; // "C" == "Augment Äuglein"
const char* strlit4 = "Base baß Baß Bast"; // "C" == "Base baß Baß Bast"
int i1;
int i2;
- int size1 = char_traits<char>::length(strlit1) - 1;
int size3 = char_traits<char>::length(strlit3) - 1;
int size4 = char_traits<char>::length(strlit4) - 1;
i1 = coll_de.compare(strlit3, strlit3 + size3, strlit3, strlit3 + 7);
VERIFY ( i1 == 1 );
- i1 = coll_de.compare(strlit3, strlit3 + 7, strlit3, strlit3 + size1);
+ i1 = coll_de.compare(strlit3, strlit3 + 7, strlit3, strlit3 + size3);
VERIFY ( i1 == -1 );
i1 = coll_de.compare(strlit3, strlit3 + 7, strlit3, strlit3 + 7);
VERIFY ( i1 == 0 );
bool b1 = true;
bool b0 = false;
unsigned long ul1 = 1294967294;
- unsigned long ul2 = 0;
unsigned long ul;
double d1 = 1.02345e+308;
double d2 = 3.15e-308;
bool b1 = true;
bool b0 = false;
unsigned long ul1 = 1294967294;
- unsigned long ul2 = 0;
unsigned long ul;
double d1 = 1.02345e+308;
double d2 = 3.15e-308;
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
date, date + traits::length(date));
string result5 = oss.str();
VERIFY( result5 == "Sunday, the second of April");
- iterator_type os_it06 = tim_put.put(oss.rdbuf(), oss, '*', &time1,
- date_ex, date_ex + traits::length(date));
+ iterator_type os_it06 = tim_put.put(oss.rdbuf(), oss, '*', &time1,
+ date_ex,
+ date_ex + traits::length(date_ex));
string result6 = oss.str();
VERIFY( result6 != result5 );
}
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
string result7 = oss.str();
VERIFY( result7 == "Sonntag, the second of April");
iterator_type os_it08 = tim_put.put(oss.rdbuf(), oss, '*', &time1,
- date_ex, date_ex + traits::length(date));
+ date_ex,
+ date_ex + traits::length(date_ex));
string result8 = oss.str();
VERIFY( result8 != result7 );
}
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
string result9 = oss.str();
VERIFY( result9 == "Sunday, the second of April");
iterator_type os_it10 = tim_put.put(oss.rdbuf(), oss, '*', &time1,
- date_ex, date_ex + traits::length(date));
+ date_ex,
+ date_ex + traits::length(date_ex));
string result10 = oss.str();
VERIFY( result10 != result9 );
}
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
string result11 = oss.str();
VERIFY( result11 == "dimanche, the second of avril");
iterator_type os_it12 = tim_put.put(oss.rdbuf(), oss, '*', &time1,
- date_ex, date_ex + traits::length(date));
+ date_ex,
+ date_ex + traits::length(date_ex));
string result12 = oss.str();
VERIFY( result12 != result11 );
}
// 2001-09-17 Benjamin Kosnik <bkoz@redhat.com>
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
+// Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
date, date + traits::length(date));
wstring result5 = oss.str();
VERIFY( result5 == L"Sunday, the second of April");
- iterator_type os_it06 = tim_put.put(oss.rdbuf(), oss, L'*', &time1,
- date_ex, date_ex + traits::length(date));
+ iterator_type os_it06 = tim_put.put(oss.rdbuf(), oss, L'*', &time1,
+ date_ex,
+ date_ex + traits::length(date_ex));
wstring result6 = oss.str();
VERIFY( result6 != result5 );
}
// 2005-11-25 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2005 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
const int A3[] = {0, 2, 3, 4, 10, 11};
const int A4[] = {4, 10, 11};
const int A5[] = {4, 10};
-const int N = sizeof(A) / sizeof(int);
-const int N1 = sizeof(A1) / sizeof(int);
-const int N2 = sizeof(A2) / sizeof(int);
-const int N3 = sizeof(A3) / sizeof(int);
-const int N4 = sizeof(A4) / sizeof(int);
-const int N5 = sizeof(A5) / sizeof(int);
+const unsigned N = sizeof(A) / sizeof(int);
+const unsigned N1 = sizeof(A1) / sizeof(int);
+const unsigned N2 = sizeof(A2) / sizeof(int);
+const unsigned N3 = sizeof(A3) / sizeof(int);
+const unsigned N4 = sizeof(A4) / sizeof(int);
+const unsigned N5 = sizeof(A5) / sizeof(int);
void
test01()
typedef deque_type::iterator iterator_type;
deque_type v, v1, v2, v3, v4, v5;
- for (int i = 0; i < N; ++i)
+ for (unsigned i = 0; i < N; ++i)
v.push_back(std::deque<int>(1, A[i]));
- for (int i = 0; i < N1; ++i)
+ for (unsigned i = 0; i < N1; ++i)
v1.push_back(std::deque<int>(1, A1[i]));
- for (int i = 0; i < N2; ++i)
+ for (unsigned i = 0; i < N2; ++i)
v2.push_back(std::deque<int>(1, A2[i]));
- for (int i = 0; i < N3; ++i)
+ for (unsigned i = 0; i < N3; ++i)
v3.push_back(std::deque<int>(1, A3[i]));
- for (int i = 0; i < N4; ++i)
+ for (unsigned i = 0; i < N4; ++i)
v4.push_back(std::deque<int>(1, A4[i]));
- for (int i = 0; i < N5; ++i)
+ for (unsigned i = 0; i < N5; ++i)
v5.push_back(std::deque<int>(1, A5[i]));
iterator_type it1 = v.erase(v.begin() + 1);
// 2005-11-25 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2005 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
const int A4[] = {2, 8, 9, 10, 11};
const int A5[] = {2, 8, 10, 11};
const int A6[] = {2, 8, 10};
-const int N = sizeof(A) / sizeof(int);
-const int N0 = sizeof(A0) / sizeof(int);
-const int N1 = sizeof(A1) / sizeof(int);
-const int N2 = sizeof(A2) / sizeof(int);
-const int N3 = sizeof(A3) / sizeof(int);
-const int N4 = sizeof(A4) / sizeof(int);
-const int N5 = sizeof(A5) / sizeof(int);
-const int N6 = sizeof(A6) / sizeof(int);
+const unsigned N = sizeof(A) / sizeof(int);
+const unsigned N0 = sizeof(A0) / sizeof(int);
+const unsigned N1 = sizeof(A1) / sizeof(int);
+const unsigned N2 = sizeof(A2) / sizeof(int);
+const unsigned N3 = sizeof(A3) / sizeof(int);
+const unsigned N4 = sizeof(A4) / sizeof(int);
+const unsigned N5 = sizeof(A5) / sizeof(int);
+const unsigned N6 = sizeof(A6) / sizeof(int);
template<int Size>
class My_class
// 2006-11-25 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
VERIFY( pp0.second == irt1.first );
}
+int
main()
{
test01();
// 2006-11-25 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
VERIFY( pp0.second == iter1 );
}
+int
main()
{
test01();
// 2006-11-25 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
VERIFY( pp0.second == iter1 );
}
+int
main()
{
test01();
// 2006-11-25 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
VERIFY( pp0.second == irt1.first );
}
+int
main()
{
test01();
// Actually, vector<bool> is special, see libstdc++/31370.
vector<bool> vb;
typedef vector<bool>::difference_type difference_type;
+ typedef vector<bool>::size_type size_type;
VERIFY( vb.max_size()
- == (numeric_limits<difference_type>::max() - int(_S_word_bit) + 1) );
+ == size_type(numeric_limits<difference_type>::max()
+ - int(_S_word_bit) + 1) );
}
int main()
-// Copyright (C) 2006 Free Software Foundation, Inc.
+// Copyright (C) 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
#include <testsuite_hooks.h>
void
-test_set(std::vector<int>& v, int size)
+test_set(std::vector<unsigned>& v, unsigned size)
{
v.clear();
- for (int i = 0; i < size; i += 4)
+ for (unsigned i = 0; i < size; i += 4)
{
v.push_back(i / 2);
v.push_back((size - 2) - (i / 2));
}
- for (int i = 1; i < size; i += 2)
+ for (unsigned i = 1; i < size; i += 2)
v.push_back(i);
}
void
-do_test01(int size)
+do_test01(unsigned size)
{
bool test __attribute__((unused)) = true;
- std::vector<int> v, s;
+ std::vector<unsigned> v, s;
- for (int j = 0; j < size; ++j)
+ for (unsigned j = 0; j < size; ++j)
{
test_set(v, size);
s = v;
VERIFY( v[j] == s[j] );
- for (int i = 0; i < j; ++i)
+ for (unsigned i = 0; i < j; ++i)
VERIFY( !(v[j] < v[i]) );
- for (int i = j; i < v.size(); ++i)
+ for (unsigned i = j; i < v.size(); ++i)
VERIFY( !(v[i] < v[j]) );
}
}
void
test01()
{
- for (int size = 4; size <= 1 << 10; size <<= 1)
+ for (unsigned size = 4; size <= 1 << 10; size <<= 1)
do_test01(size);
}
void test01()
{
manager m;
- bool b = isnormal(m);
+ isnormal(m);
}
-// Copyright (C) 2004 Free Software Foundation
+// Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
wistringstream stream;
VERIFY( stream.rdstate() == ios_base::goodbit );
wistringstream::int_type c = stream.peek();
- VERIFY( c == istringstream::traits_type::eof() );
+ VERIFY( c == wistringstream::traits_type::eof() );
VERIFY( stream.rdstate() == ios_base::eofbit );
}
// 2006-10-12 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation
+// Copyright (C) 2006, 2006 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
oss_01 << 'a';
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == string::size_type(width) );
}
int main()
// 2006-10-12 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation
+// Copyright (C) 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
oss_01 << str_01.c_str();
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == string::size_type(width) );
}
int main()
// 2006-10-12 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation
+// Copyright (C) 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
oss_01 << str_01.c_str();
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == wstring::size_type(width) );
}
int main()
// 2006-10-12 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation
+// Copyright (C) 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
oss_01 << L'a';
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == wstring::size_type(width) );
}
int main()
// 2006-10-12 Paolo Carlini <pcarlini@suse.de>
-// Copyright (C) 2006 Free Software Foundation
+// Copyright (C) 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
oss_01 << str_01.c_str();
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == wstring::size_type(width) );
}
int main()
buf01.pub_setg(lit01, lit01, (lit01 + i01));
VERIFY( i01 == buf01.in_avail() );
- VERIFY( buf01.pub_uflow() == lit01[0] );
+ VERIFY( buf01.pub_uflow() == traits_type::to_int_type(lit01[0]) );
VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[1]) );
- VERIFY( buf01.pub_uflow() == lit01[1] );
+ VERIFY( buf01.pub_uflow() == traits_type::to_int_type(lit01[1]) );
VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[2]) );
- VERIFY( buf01.pub_uflow() == lit01[2] );
+ VERIFY( buf01.pub_uflow() == traits_type::to_int_type(lit01[2]) );
VERIFY( buf01.sgetc() == traits_type::eof() );
}
buf01.pub_setg(lit01, lit01, (lit01 + i01));
VERIFY( i01 == buf01.in_avail() );
- VERIFY( buf01.pub_uflow() == lit01[0] );
+ VERIFY( buf01.pub_uflow() == traits_type::to_int_type(lit01[0]) );
VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[1]) );
- VERIFY( buf01.pub_uflow() == lit01[1] );
+ VERIFY( buf01.pub_uflow() == traits_type::to_int_type(lit01[1]) );
VERIFY( buf01.sgetc() == traits_type::to_int_type(lit01[2]) );
- VERIFY( buf01.pub_uflow() == lit01[2] );
+ VERIFY( buf01.pub_uflow() == traits_type::to_int_type(lit01[2]) );
VERIFY( buf01.sgetc() == traits_type::eof() );
}
// 981208 bkoz test functionality of basic_stringbuf for char_type == char
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
int_type c1 = strb_01.sbumpc();
int_type c2 = strb_02.sbumpc();
VERIFY( c1 != c2 );
- VERIFY( c1 == str_01[0] );
- VERIFY( c2 == str_02[0] ); //should equal first letter at this point
+ VERIFY( c1 == traits_type::to_int_type(str_01[0]) );
+ VERIFY( c2 == traits_type::to_int_type(str_02[0]) ); //should equal first letter at this point
int_type c3 = strb_01.sbumpc();
int_type c4 = strb_02.sbumpc();
VERIFY( c1 != c2 );
int_type c1 = strb_01.sbumpc();
int_type c2 = strb_02.sbumpc();
VERIFY( c1 != c2 );
- VERIFY( c1 == str_01[0] );
- VERIFY( c2 == str_02[0] ); //should equal first letter at this point
+ VERIFY( c1 == traits_type::to_int_type(str_01[0]) );
+ VERIFY( c2 == traits_type::to_int_type(str_02[0]) ); //should equal first letter at this point
int_type c3 = strb_01.sbumpc();
int_type c4 = strb_02.sbumpc();
VERIFY( c1 != c2 );
// 981208 bkoz test functionality of basic_stringbuf for char_type == char
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
c2 = strb_02.sgetc();
VERIFY( c6 == c1 ); //just by co-incidence both o's
VERIFY( c7 != c2 ); // n != i
- VERIFY( c1 == str_01[13] );
- VERIFY( c2 == str_02[13] ); //should equal fourteenth letter at this point
+ VERIFY( c1 == traits_type::to_int_type(str_01[13]) );
+ VERIFY( c2 == traits_type::to_int_type(str_02[13]) ); //should equal fourteenth letter at this point
strmsz_1 = strb_03.sgetn(carray1, 10);
VERIFY( !strmsz_1 ); //zero
strmsz_1 = strb_02.in_avail();
// 981208 bkoz test functionality of basic_stringbuf for char_type == wchar_t
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
c2 = strb_02.sgetc();
VERIFY( c6 == c1 ); //just by co-incidence both o's
VERIFY( c7 != c2 ); // n != i
- VERIFY( c1 == str_01[13] );
- VERIFY( c2 == str_02[13] ); //should equal fourteenth letter at this point
+ VERIFY( c1 == traits_type::to_int_type(str_01[13]) );
+ VERIFY( c2 == traits_type::to_int_type(str_02[13]) ); //should equal fourteenth letter at this point
strmsz_1 = strb_03.sgetn(carray1, 10);
VERIFY( !strmsz_1 ); //zero
strmsz_1 = strb_02.in_avail();
// 981208 bkoz test functionality of basic_stringbuf for char_type == char
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
c7 = strb_02.snextc();
VERIFY( c6 != c8 );
VERIFY( c7 != c9 );
- VERIFY( c6 == str_01[3] );
- VERIFY( c7 == str_02[3] ); //should equal fourth letter at this point
+ VERIFY( c6 == traits_type::to_int_type(str_01[3]) );
+ VERIFY( c7 == traits_type::to_int_type(str_02[3]) ); //should equal fourth letter at this point
c5 = strb_03.snextc();
VERIFY( c5 == traits_type::eof() );
}
// 981208 bkoz test functionality of basic_stringbuf for char_type == wchar_t
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// 2006, 2007
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
c7 = strb_02.snextc();
VERIFY( c6 != c8 );
VERIFY( c7 != c9 );
- VERIFY( c6 == str_01[3] );
- VERIFY( c7 == str_02[3] ); //should equal fourth letter at this point
+ VERIFY( c6 == traits_type::to_int_type(str_01[3]) );
+ VERIFY( c7 == traits_type::to_int_type(str_02[3]) ); //should equal fourth letter at this point
c5 = strb_03.snextc();
VERIFY( c5 == traits_type::eof() );
}
// { dg-require-iconv "ISO-8859-1" }
-// Copyright (C) 2004, 2007 Free Software Foundation
+// Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
#include <locale>
#include <cstring>
+#include <cstddef>
#include <testsuite_hooks.h>
#include <ext/enc_filebuf.h>
std::streamsize n = fb.sputn(str, std::strlen(str));
int s = fb.pubsync();
fb.close();
-
- VERIFY( n == std::strlen(str) );
+
+ VERIFY( std::size_t(n) == std::strlen(str) );
VERIFY( s == 0 );
return 0;
// -*- C++ -*-
-// Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+// Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the terms
push(const int& r_str);
// Returns a const reference to the largest int in the container.
- const int
+ int
top() const
{
assert(!empty());
oss_01 << str_01;
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == __gnu_cxx::__vstring::size_type(width) );
}
int main()
oss_01 << str_01;
VERIFY( oss_01.good() );
- VERIFY( oss_01.str().size() == width );
+ VERIFY( oss_01.str().size() == __gnu_cxx::__wvstring::size_type(width) );
}
int main()
#endif
pthread_attr_t tattr;
- int ret = pthread_attr_init(&tattr);
+ pthread_attr_init(&tattr);
shared_and_weak_pools pools(obj_pool, weak_pool[0]);
pthread_create(threads, &tattr, thread_hammer_and_kill, reinterpret_cast<void*>(&pools));
#endif
pthread_attr_t tattr;
- int ret = pthread_attr_init(&tattr);
+ pthread_attr_init(&tattr);
shared_and_weak_pools pools(obj_pool, weak_pool[0]);
pthread_create(threads, &tattr, thread_hammer_and_kill, reinterpret_cast<void*>(&pools));
#include <testsuite_hooks.h>
// libstdc++/33128
-int test01()
+void test01()
{
bool test __attribute__((unused)) = true;
char s[] = "a+b|c";
test_type re;
- re.assign(s, s + sizeof(s));
+ re.assign(s, s + 5);
}
int
wchar_t s[] = L"a+b|c";
test_type re;
- re.assign(s, s + sizeof(s));
+ re.assign(s, s + 5);
}
int
typedef std::tr1::basic_regex<char> test_type;
char s[] = "a+b|c";
- test_type re(s, s + sizeof(s));
+ test_type re(s, s + 5);
}
int
typedef std::tr1::basic_regex<wchar_t> test_type;
wchar_t s[] = L"a+b|c";
- test_type re(s, s + sizeof(s));
+ test_type re(s, s + 5);
}
int
run_tests_wrapped_locale(const char* name, const func_callback& l)
{
using namespace std;
- bool test = true;
// Set the global locale.
locale loc_name = locale(name);
const func_callback& l)
{
using namespace std;
- bool test = true;
#ifdef _GLIBCXX_HAVE_SETENV
// Set the global locale.
VERIFY(valid == false);
val = newval;
valid = true;
+ return *this;
}
rvalstruct(rvalstruct&& in)
{
val = newval;
valid = true;
+ return *this;
}
bool
++copycount;
val = in.val;
valid = true;
+ return true;
}
copycounter&