2012-08-23 03:47:13 +08:00
|
|
|
// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-constraints=range -analyzer-store=region -verify -Wno-objc-root-class %s
|
2009-02-19 12:07:38 +08:00
|
|
|
|
|
|
|
typedef struct Foo { int x; } Bar;
|
|
|
|
|
|
|
|
@interface MyClass {}
|
|
|
|
- (Bar)foo;
|
|
|
|
@end
|
|
|
|
@implementation MyClass
|
|
|
|
- (Bar)foo {
|
|
|
|
struct Foo f = { 0 };
|
|
|
|
return f;
|
|
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
|
|
void createFoo() {
|
|
|
|
MyClass *obj = 0;
|
2011-10-29 03:05:10 +08:00
|
|
|
Bar f = [obj foo]; // no-warning
|
2009-02-19 12:07:38 +08:00
|
|
|
}
|
|
|
|
|
2009-04-01 14:52:48 +08:00
|
|
|
void createFoo2() {
|
|
|
|
MyClass *obj = 0;
|
|
|
|
[obj foo]; // no-warning
|
2011-10-29 03:05:10 +08:00
|
|
|
Bar f = [obj foo]; // no-warning
|
2009-04-01 14:52:48 +08:00
|
|
|
}
|
|
|
|
|