https://llvm.org/bugs/show_bug.cgi?id=27214
Bug ID: 27214
Summary: call to 'wcsrchr' is ambiguous
Product: libc++
Version: unspecified
Hardware: PC
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
Hi, I've encounter an error which seems to be problem inside libc++.
When including <cwchar>, I'm getting two conflicting wcsrchr() functions, one
in std and the other in global namespace. This causes error when "using
namespace std" - see example bellow.
// wcsrchr_test.cc
#include <cwchar>
int main()
{
const wchar_t * str = L"hello world";
std::wcsrchr(str, 'w'); // OK
::wcsrchr(str, 'w'); // OK
wcsrchr(str, 'w'); // OK
using namespace std;
std::wcsrchr(str, 'w'); // OK
::wcsrchr(str, 'w'); // OK
wcsrchr(str, 'w'); // error: call to 'wcsrchr' is ambiguous
}
wcsrchr_test.cc:14:5: error: call to 'wcsrchr' is ambiguous
wcsrchr(str, 'w'); // error: call to 'wcsrchr' is ambiguous
^~~~~~~
/usr/include/wchar.h:137:10: note: candidate function
wchar_t *wcsrchr(const wchar_t *, wchar_t);
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwchar:186:49:
note: candidate function
inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsrchr(const wchar_t* __s,
wchar_t __c) {return ::wcsrchr(__s, __c);}
^
1 error generated.
Tested on OSX 10.11.3, /usr/lib/libc++.1.dylib (compatibility version 1.0.0,
current version 120.1.0)
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs