From fcc855922629461ec529fe857d951adeccf1941d Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 28 Oct 2005 16:42:09 +0000 Subject: [PATCH] re PR libstdc++/24559 (Incorrect definition of wcspbrk in cwchar) 2005-10-28 Paolo Carlini 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 | 6 ++++ libstdc++-v3/include/c_std/std_cwchar.h | 4 +-- .../21_strings/c_strings/wchar_t/24559.cc | 32 +++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/24559.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 4c78ad2cf6a..ceea46da626 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2005-10-28 Paolo Carlini + + 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 * docs/html/ext/lwg-active.html, lwg-defects.html: Import Revision 39. diff --git a/libstdc++-v3/include/c_std/std_cwchar.h b/libstdc++-v3/include/c_std/std_cwchar.h index 26c4264ef34..9eaaa4ab579 100644 --- a/libstdc++-v3/include/c_std/std_cwchar.h +++ b/libstdc++-v3/include/c_std/std_cwchar.h @@ -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(__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 index 00000000000..26f03267855 --- /dev/null +++ b/libstdc++-v3/testsuite/21_strings/c_strings/wchar_t/24559.cc @@ -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 + +// { dg-do compile } + +// libstdc++/24559 +int main() +{ + typedef wchar_t* (*pf)(wchar_t *, const wchar_t*); + pf p1 = std::wcspbrk; + + return 0; +}