2017-03-04 02:02:02 +08:00
|
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify -Wno-objc-root-class %s
|
2012-10-19 20:44:48 +08:00
|
|
|
// expected-no-diagnostics
|
2012-09-18 03:13:56 +08:00
|
|
|
|
|
|
|
// Test reasoning about static locals in ObjCMethods.
|
|
|
|
int *getValidPtr();
|
|
|
|
@interface Radar11275803
|
|
|
|
- (int) useStaticInMethod;
|
|
|
|
@end
|
|
|
|
@implementation Radar11275803
|
|
|
|
|
|
|
|
- (int) useStaticInMethod
|
|
|
|
{
|
|
|
|
static int *explInit = 0;
|
|
|
|
static int implInit;
|
|
|
|
if (!implInit)
|
|
|
|
explInit = getValidPtr();
|
|
|
|
return *explInit; //no-warning
|
|
|
|
}
|
|
|
|
@end
|