Following on from my answer to this question, in both C++11 and C++14:
[C++11, C++14: 25.5/2]:
The contents are the same as the Standard C library header<stdlib.h>
with the following exceptions:
[C++11, C++14: 25.5/3]:
The function signature:bsearch(const void *, const void *, size_t, size_t, int (*)(const void *, const void *));
is replaced by the two declarations:
extern "C" void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)); extern "C++" void *bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
both of which have the same behavior as the original declaration.
However,
[C++11, C++14: 7.5/5]:
If two declarations declare functions with the same name and parameter-type-list (8.3.5) to be members of the same namespace or declare objects with the same name to be members of the same namespace and the declarations give the names different language linkages, the program is ill-formed; no diagnostic is required if the declarations appear in different translation units. [..]
Is this a defect?