re PR libstdc++/24559 (Incorrect definition of wcspbrk in cwchar)

2005-10-28  Paolo Carlini  <pcarlini@suse.de>

	PR libstdc++/24559
	* include/c_std/std_cwchar.h (wcspbrk): Adjust signature.
	* testsuite/21_strings/c_strings/wchar_t/24559.cc: New.

From-SVN: r105939
This commit is contained in:
Paolo Carlini 2005-10-28 16:42:09 +00:00 committed by Paolo Carlini
parent 6c301b82b4
commit fcc8559226
3 changed files with 40 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2005-10-28 Paolo Carlini <pcarlini@suse.de>
PR libstdc++/24559
* include/c_std/std_cwchar.h (wcspbrk): Adjust signature.
* testsuite/21_strings/c_strings/wchar_t/24559.cc: New.
2005-10-25 Paolo Carlini <pcarlini@suse.de>
* docs/html/ext/lwg-active.html, lwg-defects.html: Import Revision 39.

View File

@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@ -211,7 +211,7 @@ namespace std
using ::wcspbrk;
inline wchar_t*
wcspbrk(wchar_t* __s1, wchar_t* __s2)
wcspbrk(wchar_t* __s1, const wchar_t* __s2)
{ return wcspbrk(const_cast<const wchar_t*>(__s1), __s2); }
using ::wcsrchr;

View File

@ -0,0 +1,32 @@
// Copyright (C) 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
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// 21.4: null-terminated sequence utilities
#include <cwchar>
// { dg-do compile }
// libstdc++/24559
int main()
{
typedef wchar_t* (*pf)(wchar_t *, const wchar_t*);
pf p1 = std::wcspbrk;
return 0;
}