1 // RUN: %clang_analyze_cc1 %s -o %t
3 // Tests that some specific checkers are enabled by default.
9 title = @"foo"; // expected-warning {{never read}}
20 // <rdar://problem/8808566> Static analyzer is wrong: NSWidth(imgRect) not understood as unconditional assignment
22 // Note: this requires inlining support. This previously issued a false positive use of
23 // uninitialized value when calling NSWidth.
24 typedef double CGFloat;
30 typedef struct CGPoint CGPoint;
36 typedef struct CGSize CGSize;
42 typedef struct CGRect CGRect;
44 typedef CGRect NSRect;
45 typedef CGSize NSSize;
47 static __inline__ __attribute__((always_inline)) CGFloat NSWidth(NSRect aRect) {
48 return (aRect.size.width);
51 static __inline__ __attribute__((always_inline)) CGFloat NSHeight(NSRect aRect) {
52 return (aRect.size.height);
55 NSSize rdar880566_size(void);
57 double rdar8808566(void) {
59 myRect.size = rdar880566_size();
60 double x = NSWidth(myRect) + NSHeight(myRect); // no-warning