diff options
Diffstat (limited to 'gcc/testsuite/obj-c++.dg/lvalue-cast-1.mm')
-rw-r--r-- | gcc/testsuite/obj-c++.dg/lvalue-cast-1.mm | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/testsuite/obj-c++.dg/lvalue-cast-1.mm b/gcc/testsuite/obj-c++.dg/lvalue-cast-1.mm new file mode 100644 index 00000000000..f2575efc631 --- /dev/null +++ b/gcc/testsuite/obj-c++.dg/lvalue-cast-1.mm @@ -0,0 +1,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 |