This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24559] New: Incorrect definition of wcspbrk in cwchar
- From: "david dot moore at intel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Oct 2005 18:03:32 -0000
- Subject: [Bug c++/24559] New: Incorrect definition of wcspbrk in cwchar
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
According to the C++ standard the declarations of wcspbrk should take two cont
pointers or a (non-const pointer and a const pointer (in that order):
The actual declarations as if gcc 4.0 and apparently since introduction of the
second declaration take either two const pointers or two non-const pointers:
const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2);
wchar_t* wcspbrk( wchar_t* s1, const wchar_t* s2);
As a result the following (rather artificial) program does not compile when it
should:
#include <cwchar>
typedef wchar_t* (*pf)(wchar_t *, const wchar_t*);
int main() {
pf p1 = std::wcspbrk; // should compile
return 0;
}
--
Summary: Incorrect definition of wcspbrk in cwchar
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: david dot moore at intel dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24559