functions, ask it whether it did provide them after the fact. Some versions of
glibc fail to compile if you make this request and don't also claim to be at
least GCC 4.3.
llvm-svn: 260622
<string.h> and wcschr, wcspbrk, wcsrchr, wmemchr, and wcsstr from <wchar.h> to
provide a const-correct overload set even when the underlying C library does
not.
This change adds a new macro, _LIBCPP_PREFERRED_OVERLOAD, which (if defined)
specifies that a given overload is a better match than an otherwise equally
good function declaration without the overload. This is implemented in modern
versions of Clang via __attribute__((enable_if)), and not elsewhere.
We use this new macro to define overloads in the global namespace for these
functions that displace the overloads provided by the C library, unless we
believe the C library is already providing the correct signatures.
llvm-svn: 260337
This change caused problems when building code like povray that:
a) uses 'using namespace std;'
b) is built on an environment where the C library provides the "wrong"
(non-const-correct) interface for the str* functions
c) makes an unqualified call to one of those str* functions
A patch is out for review to add a facility to fix this (and to give the
correct signatures for these functions whenever possible, even when the C
library does not do so). This revert is expected to be temporary.
llvm-svn: 251665
Also fix the overload set for the five functions whose signatures change in the
case where we can fix it. This is already covered by existing tests for the
affected systems.
llvm-svn: 249929