view gcc/testsuite/objc.dg/type-size-1.m @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* Reject ivars with an unknown size.  */
/* Contributed by Ziemowit Laski <zlaski@apple.com>.  */
/* { dg-do compile } */

struct unknownStruct;

@interface ArrayTest
{
    short   unknownSize[unknownValue];  /* { dg-error ".unknownValue. (undeclared|was not declared)" } */
    /* { dg-error "instance variable .unknownSize. has unknown size" "" { target *-*-* } .-1 } */
    struct unknownStruct unknownObj;  /* { dg-error "field .unknownObj. has incomplete type" } */
    /* { dg-error "instance variable .unknownObj. has unknown size" "" { target *-*-* } .-1 } */
    long    knownSize[3];     /* ok */
    char    zeroSize[2 - 2];  /* ok (apparently) */
    int     missingSize[];  /* { dg-error "instance variable .missingSize. has unknown size" } */
}
@end