| 1 | // RUN: %clang_analyze_cc1 -analyzer-checker=core -verify -Wno-objc-root-class %s |
|---|---|
| 2 | // expected-no-diagnostics |
| 3 | |
| 4 | // Test reasoning about static locals in ObjCMethods. |
| 5 | int *getValidPtr(); |
| 6 | @interface Radar11275803 |
| 7 | - (int) useStaticInMethod; |
| 8 | @end |
| 9 | @implementation Radar11275803 |
| 10 | |
| 11 | - (int) useStaticInMethod |
| 12 | { |
| 13 | static int *explInit = 0; |
| 14 | static int implInit; |
| 15 | if (!implInit) |
| 16 | explInit = getValidPtr(); |
| 17 | return *explInit; //no-warning |
| 18 | } |
| 19 | @end |