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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
/* run.config
STDOPT:
STDOPT: #"-c11"
*/ // Note: redefinition of local typedefs is currently unsupported
typedef int myint;
typedef int myint; //valid in C11 only
typedef int list[2];
typedef int list[2]; //valid in C11 only
typedef struct { int a; } st;
typedef struct { int a; } st; //invalid
typedef st st1; //valid
typedef union { int a; } u;
typedef union { int a; } u; //invalid
typedef enum {A} e;
typedef enum {A} e; // invalid
typedef enum {B} e1;
typedef enum {B} e2; // invalid (B redefined)
typedef struct {int a;} st1; //invalid
typedef int I;
void f() {
typedef int I; //valid (not same scope)
{ typedef int I; }//valid (not same scope)
}
typedef int vi;
typedef volatile int vi; //invalid
typedef int ci;
typedef const int ci; //invalid
typedef __attribute__((aligned(8))) int ai;
typedef int ai; //valid in C11 only
typedef int *ftest_t;
typedef double ftest_t; //invalid
// tests of valid composite type redefinitions
typedef struct _stt { int a; } stt;
typedef struct _stt stt; //valid in C11 only
typedef struct _stt2 stt; //invalid
typedef struct _stt stt2; //valid
void g() {
typedef struct _stt { int a; } stt; //valid
}
void h() {
typedef struct _stt stt; //valid
}
typedef int magic;
void i() {
typedef void (*magic)(void); //valid
{ typedef struct {int obj;} magic; } //valid
magic m = (magic) g; //valid (test scoping of local typedef)
}
magic m = 2; //valid (test scoping of local typedef)
void main(ftest_t i) { }
|