2011-02-19 04:55:19 +08:00
|
|
|
// RUN: %clang_cc1 -analyze -analyzer-check-objc-mem -verify %s
|
|
|
|
|
|
|
|
int f1(char *dst) {
|
|
|
|
char *p = dst + 4;
|
|
|
|
char *q = dst + 3;
|
|
|
|
return !(q >= p);
|
|
|
|
}
|
2011-02-19 05:24:56 +08:00
|
|
|
|
2011-02-19 09:08:41 +08:00
|
|
|
long f2(char *c) {
|
|
|
|
return long(c) & 1;
|
|
|
|
}
|
|
|
|
|
2011-02-19 09:59:41 +08:00
|
|
|
bool f3() {
|
|
|
|
return !false;
|
|
|
|
}
|
|
|
|
|
2011-02-19 05:24:56 +08:00
|
|
|
namespace {
|
|
|
|
|
|
|
|
struct A { };
|
|
|
|
struct B {
|
2011-02-19 10:53:41 +08:00
|
|
|
operator A() { return A(); }
|
2011-02-19 05:24:56 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
A f(char *dst) {
|
|
|
|
B b;
|
|
|
|
return b;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|