re PR libstdc++/24559 (Incorrect definition of wcspbrk in cwchar)
authorPaolo Carlini <pcarlini@suse.de>
Fri, 28 Oct 2005 16:42:09 +0000 (16:42 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 28 Oct 2005 16:42:09 +0000 (16:42 +0000)
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

libstdc++-v3/ChangeLog
libstdc++-v3/include/c_std/std_cwchar.h
libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/24559.cc [new file with mode: 0644]

index 4c78ad2cf6a769bd46817497322fc65749ce21a2..ceea46da6260788c187853aeed77c6cc6c1cd486 100644 (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.
index 26c4264ef34e77932088b39e1865418d35790c28..9eaaa4ab579bb83d65213160b7f5768a19630285 100644 (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;
diff --git a/libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/24559.cc b/libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/24559.cc
new file mode 100644 (file)
index 0000000..26f0326
--- /dev/null
@@ -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;
+}