xref: /minix3/external/bsd/libc++/dist/libcxx/test/depr/depr.c.headers/string_h.pass.cpp (revision 4684ddb6aab0b36791c8099bc705d6140b3d05d0)
1*4684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
2*4684ddb6SLionel Sambuc //
3*4684ddb6SLionel Sambuc //                     The LLVM Compiler Infrastructure
4*4684ddb6SLionel Sambuc //
5*4684ddb6SLionel Sambuc // This file is dual licensed under the MIT and the University of Illinois Open
6*4684ddb6SLionel Sambuc // Source Licenses. See LICENSE.TXT for details.
7*4684ddb6SLionel Sambuc //
8*4684ddb6SLionel Sambuc //===----------------------------------------------------------------------===//
9*4684ddb6SLionel Sambuc 
10*4684ddb6SLionel Sambuc // <string.h>
11*4684ddb6SLionel Sambuc 
12*4684ddb6SLionel Sambuc #include <string.h>
13*4684ddb6SLionel Sambuc #include <type_traits>
14*4684ddb6SLionel Sambuc 
15*4684ddb6SLionel Sambuc #ifndef NULL
16*4684ddb6SLionel Sambuc #error NULL not defined
17*4684ddb6SLionel Sambuc #endif
18*4684ddb6SLionel Sambuc 
main()19*4684ddb6SLionel Sambuc int main()
20*4684ddb6SLionel Sambuc {
21*4684ddb6SLionel Sambuc     size_t s = 0;
22*4684ddb6SLionel Sambuc     void* vp = 0;
23*4684ddb6SLionel Sambuc     const void* vpc = 0;
24*4684ddb6SLionel Sambuc     char* cp = 0;
25*4684ddb6SLionel Sambuc     const char* cpc = 0;
26*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(memcpy(vp, vpc, s)), void*>::value), "");
27*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(memmove(vp, vpc, s)), void*>::value), "");
28*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strcpy(cp, cpc)), char*>::value), "");
29*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strncpy(cp, cpc, s)), char*>::value), "");
30*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strcat(cp, cpc)), char*>::value), "");
31*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strncat(cp, cpc, s)), char*>::value), "");
32*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(memcmp(vpc, vpc, s)), int>::value), "");
33*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strcmp(cpc, cpc)), int>::value), "");
34*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strncmp(cpc, cpc, s)), int>::value), "");
35*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strcoll(cpc, cpc)), int>::value), "");
36*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strxfrm(cp, cpc, s)), size_t>::value), "");
37*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(memchr(vp, 0, s)), void*>::value), "");
38*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strchr(cp, 0)), char*>::value), "");
39*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strcspn(cpc, cpc)), size_t>::value), "");
40*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strpbrk(cp, cpc)), char*>::value), "");
41*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strrchr(cp, 0)), char*>::value), "");
42*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strspn(cpc, cpc)), size_t>::value), "");
43*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strstr(cp, cpc)), char*>::value), "");
44*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strtok(cp, cpc)), char*>::value), "");
45*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(memset(vp, 0, s)), void*>::value), "");
46*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strerror(0)), char*>::value), "");
47*4684ddb6SLionel Sambuc     static_assert((std::is_same<decltype(strlen(cpc)), size_t>::value), "");
48*4684ddb6SLionel Sambuc }
49