<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - call to 'wcsrchr' is ambiguous"
href="https://llvm.org/bugs/show_bug.cgi?id=27214">27214</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>call to 'wcsrchr' is ambiguous
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>radek.brich@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>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)</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>