+2005-08-24 Lawrence Lim <llim@redhat.com>
+ Jakub Jelinek <jakub@redhat.com>
+ Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/23550
+ * testsuite/21_strings/char_traits/requirements/char/1.cc
+ (test01): Simplify counting.
+ * testsuite/21_strings/char_traits/requirements/wchar_t/1.cc
+ (test02): Same.
+
2005-07-18 Paolo Carlini <pcarlini@suse.de>
Nathan Myers <ncm@cantrip.org>
// 1999-06-03 bkoz
-// Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005
+// 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
// 21.1.1 character traits requirements
// Key for decoding what function signatures really mean:
- // X == char_traits<_CharT>
+ // X == char_traits<_CharT>
// [c,d] == _CharT
// [p,q] == const _CharT*
- // s == _CharT*
+ // s == _CharT*
// [n,i,j] == size_t
- // f == X::int_type
+ // f == X::int_type
// pos == X::pos_type
// state == X::state_type
// correctly even where p is in [s, s + n), and yields s.
char array1[] = {'z', 'u', 'm', 'a', ' ', 'b', 'e', 'a', 'c', 'h', 0};
const char str_lit1[] = "montara and ocean beach";
- int len = sizeof(str_lit1) + sizeof(array1) - 1; // two terminating chars
- char array2[len];
- std::char_traits<char>::copy(array2, "boracay, philippines", len);
+ const char str_lit2[] = "boracay, philippines";
+ const int len1 = sizeof(str_lit1)/sizeof(char);
+ const int len2 = sizeof(str_lit2)/sizeof(char);
+ char array2[len1 + len2 - 1]; // two terminating chars
+ std::char_traits<char>::copy(array2, str_lit2, len2);
VERIFY( str_lit1[0] == 'm' );
c1 = array2[0];
// 1999-06-03 bkoz
-// Copyright (C) 1999, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005
+// 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
// correctly even where p is in [s, s + n), and yields s.
wchar_t array1[] = {L'z', L'u', L'm', L'a', L' ', L'b', L'e', L'a', L'c', L'h', 0};
const wchar_t str_lit1[] = L"montara and ocean beach";
- int len = sizeof(str_lit1) + sizeof(array1) - 1; // two terminating chars
- wchar_t array2[len];
- std::char_traits<wchar_t>::copy(array2, L"boracay, philippines", len);
+ const wchar_t str_lit2[] = L"boracay, philippines";
+ const int len1 = sizeof(str_lit1)/sizeof(wchar_t);
+ const int len2 = sizeof(str_lit2)/sizeof(wchar_t);
+ wchar_t array2[len1 + len2 - 1]; // two terminating chars
+ std::char_traits<wchar_t>::copy(array2, str_lit2, len2);
VERIFY( str_lit1[0] == 'm' );
c1 = array2[0];