aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/objc.dg/lvalue-cast-1.m
blob: f2575efc6310150d5e478bf4d387a2b4b1f4f810 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* APPLE LOCAL file non lvalue assign */
/* { dg-do compile } */
/* { dg-options "-fnon-lvalue-assign" } */

#include <objc/Object.h>

typedef struct _NSPoint {
    float x; 
    float y;
} NSPoint;
typedef NSPoint *NSPointPointer;
typedef NSPoint *NSPointArray;
typedef struct _NSSize {
    float width;
    float height;
} NSSize;
typedef struct _NSRect {
     NSPoint origin;
     NSSize size;
} NSRect;

@interface NSLayoutManager: Object {
  NSRect *_cachedRectArray;
}
- (void)_growCachedRectArrayToSize:(unsigned)newSize;
@end

@implementation NSLayoutManager
- (void)_growCachedRectArrayToSize:(unsigned)newSize {
  ( NSRect *)_cachedRectArray = nil;  /* { dg-warning "target of assignment not really an lvalue" } */
}
@end