1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,unix -verify %s
3 // expected-no-diagnostics
5 // Test functions that are called "memcpy" but aren't the memcpy
6 // we're looking for. Unfortunately, this test cannot be put into
7 // a namespace. The out-of-class weird memcpy needs to be recognized
8 // as a normal C function for the test to make sense.
9 typedef __typeof(sizeof(int)) size_t;
10 void *memcpy(void *, const void *, size_t);
15 // A weird overload within the class that accepts a structure reference
16 // instead of a pointer.
17 void memcpy(void *, const S
&, size_t);
18 void test_in_class_weird_memcpy() {
19 memcpy(this, s2
, 1); // no-crash
23 // A similarly weird overload outside of the class.
24 void *memcpy(void *, const S
&, size_t);
26 void test_out_of_class_weird_memcpy() {
27 memcpy(&S::s1
, S::s2
, 1); // no-crash