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