|
@@ -6,15 +6,15 @@ struct foo { int a, b; };
|
|
static struct foo t = (struct foo){0,0};
|
|
static struct foo t = (struct foo){0,0};
|
|
static struct foo t1 = __builtin_choose_expr(0, (struct foo){0,0}, (struct foo){0,0});
|
|
static struct foo t1 = __builtin_choose_expr(0, (struct foo){0,0}, (struct foo){0,0});
|
|
static struct foo t2 = {0,0};
|
|
static struct foo t2 = {0,0};
|
|
-static struct foo t3 = t2; // -expected-error {{initializer element is not a compile-time constant}}
|
|
|
|
|
|
+static struct foo t3 = t2; // expected-error {{initializer element is not a compile-time constant}}
|
|
static int *p = (int []){2,4};
|
|
static int *p = (int []){2,4};
|
|
static int x = (int){1};
|
|
static int x = (int){1};
|
|
|
|
|
|
-static int *p2 = (int []){2,x}; // -expected-error {{initializer element is not a compile-time constant}}
|
|
|
|
-static long *p3 = (long []){2,"x"}; // -expected-warning {{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [2]'}}
|
|
|
|
|
|
+static int *p2 = (int []){2,x}; // expected-error {{initializer element is not a compile-time constant}}
|
|
|
|
+static long *p3 = (long []){2,"x"}; // expected-warning {{incompatible pointer to integer conversion initializing 'long' with an expression of type 'char [2]'}}
|
|
|
|
|
|
-typedef struct { } cache_t; // -expected-warning{{empty struct is a GNU extension}}
|
|
|
|
-static cache_t clo_I1_cache = ((cache_t) { } ); // -expected-warning{{use of GNU empty initializer extension}}
|
|
|
|
|
|
+typedef struct { } cache_t; // expected-warning{{empty struct is a GNU extension}}
|
|
|
|
+static cache_t clo_I1_cache = ((cache_t) { } ); // expected-warning{{use of GNU empty initializer extension}}
|
|
|
|
|
|
typedef struct Test {int a;int b;} Test;
|
|
typedef struct Test {int a;int b;} Test;
|
|
static Test* ll = &(Test) {0,0};
|
|
static Test* ll = &(Test) {0,0};
|
|
@@ -27,11 +27,11 @@ int main(int argc, char **argv) {
|
|
}
|
|
}
|
|
|
|
|
|
struct Incomplete; // expected-note{{forward declaration of 'struct Incomplete'}}
|
|
struct Incomplete; // expected-note{{forward declaration of 'struct Incomplete'}}
|
|
-struct Incomplete* I1 = &(struct Incomplete){1, 2, 3}; // -expected-error {{variable has incomplete type}}
|
|
|
|
|
|
+struct Incomplete* I1 = &(struct Incomplete){1, 2, 3}; // expected-error {{variable has incomplete type}}
|
|
void IncompleteFunc(unsigned x) {
|
|
void IncompleteFunc(unsigned x) {
|
|
- struct Incomplete* I2 = (struct foo[x]){1, 2, 3}; // -expected-error {{variable-sized object may not be initialized}}
|
|
|
|
- (void){1,2,3}; // -expected-error {{variable has incomplete type}}
|
|
|
|
- (void(void)) { 0 }; // -expected-error{{illegal initializer type 'void (void)'}}
|
|
|
|
|
|
+ struct Incomplete* I2 = (struct foo[x]){1, 2, 3}; // expected-error {{variable-sized object may not be initialized}}
|
|
|
|
+ (void){1,2,3}; // expected-error {{variable has incomplete type}}
|
|
|
|
+ (void(void)) { 0 }; // expected-error{{illegal initializer type 'void (void)'}}
|
|
}
|
|
}
|
|
|
|
|
|
// PR6080
|
|
// PR6080
|