xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/memset-invalid-1.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only %s -verify
2*f4a2713aSLionel Sambuc // rdar://13081751
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc typedef __SIZE_TYPE__ size_t;
5*f4a2713aSLionel Sambuc void *memset(void*, int, size_t);
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc typedef struct __incomplete *incomplete;
8*f4a2713aSLionel Sambuc 
mt_query_for_domain(const char * domain)9*f4a2713aSLionel Sambuc void mt_query_for_domain(const char *domain)
10*f4a2713aSLionel Sambuc {
11*f4a2713aSLionel Sambuc 	incomplete	query = 0;
12*f4a2713aSLionel Sambuc 	memset(query, 0, sizeof(query)); // expected-warning {{'memset' call operates on objects of type 'struct __incomplete' while the size is based on a different type 'incomplete'}} \
13*f4a2713aSLionel Sambuc 	// expected-note {{did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?}}
14*f4a2713aSLionel Sambuc }
15*f4a2713aSLionel Sambuc 
16