This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[v3] libstdc++/24559
- From: Paolo Carlini <pcarlini at suse dot de>
- To: "'gcc-patches at gcc dot gnu dot org'" <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 28 Oct 2005 18:41:31 +0200
- Subject: [v3] libstdc++/24559
Hi,
I'm going to commit to mainline and 4_0-branch the below trivial patch,
tested x86-linux.
Paolo.
////////////
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.
Index: include/c_std/std_cwchar.h
===================================================================
--- include/c_std/std_cwchar.h (revision 105936)
+++ include/c_std/std_cwchar.h (working copy)
@@ -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 @@
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;
Index: testsuite/21_strings/c_strings/wchar_t/24559.cc
===================================================================
--- testsuite/21_strings/c_strings/wchar_t/24559.cc (revision 0)
+++ testsuite/21_strings/c_strings/wchar_t/24559.cc (revision 0)
@@ -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;
+}