reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced
    1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
// RUN: %clang_analyze_cc1 -analyzer-checker=core -verify -Wno-objc-root-class %s
// expected-no-diagnostics

// 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