blob: 48bac623b55495494a1a574b4c5dac486cb0ca90 [file] [log] [blame]
Ted Kremenek033a07e2011-08-03 23:14:55 +00001// RUN: %clang_cc1 -analyze -analyzer-checker=core,experimental.core -analyzer-constraints=basic -analyzer-store=region %s -verify
Ted Kremenek98f1e1c2009-02-19 04:07:38 +00002
3typedef struct Foo { int x; } Bar;
4
5@interface MyClass {}
6- (Bar)foo;
7@end
8@implementation MyClass
9- (Bar)foo {
10 struct Foo f = { 0 };
11 return f;
12}
13@end
14
15void createFoo() {
16 MyClass *obj = 0;
Ted Kremenek4a037c72011-10-28 19:05:10 +000017 Bar f = [obj foo]; // no-warning
Ted Kremenek98f1e1c2009-02-19 04:07:38 +000018}
19
Ted Kremenekb930d7a2009-04-01 06:52:48 +000020void createFoo2() {
21 MyClass *obj = 0;
22 [obj foo]; // no-warning
Ted Kremenek4a037c72011-10-28 19:05:10 +000023 Bar f = [obj foo]; // no-warning
Ted Kremenekb930d7a2009-04-01 06:52:48 +000024}
25