summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/compound-literal.c
diff options
context:
space:
mode:
authorAndy Gibbs <andyg1001@hotmail.co.uk>2012-10-19 12:36:49 +0000
committerAndy Gibbs <andyg1001@hotmail.co.uk>2012-10-19 12:36:49 +0000
commitac51de6ec2f01fce1d9dadf59a86ffe825c42bc7 (patch)
tree0791be5a26a231653d9a6c1aa0172dca1afc4662 /clang/test/Sema/compound-literal.c
parent8eb77d847e8a5cba03682bd948613c7162e56a86 (diff)
downloadbcm5719-llvm-ac51de6ec2f01fce1d9dadf59a86ffe825c42bc7.tar.gz
bcm5719-llvm-ac51de6ec2f01fce1d9dadf59a86ffe825c42bc7.zip
Fix directive parsing in VerifyDiagnosticConsumer so that it ensures that "expected" is at the start of the word and will no longer accept typos such as "junkexpected-*" as a valid "expected-*" directive. A very few test-cases had to be amended to adhere to the new rule.
Patch reviewed by David Blaikie. llvm-svn: 166279
Diffstat (limited to 'clang/test/Sema/compound-literal.c')
-rw-r--r--clang/test/Sema/compound-literal.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/clang/test/Sema/compound-literal.c b/clang/test/Sema/compound-literal.c
index bac7b0e6024..c5c0c17143f 100644
--- a/clang/test/Sema/compound-literal.c
+++ b/clang/test/Sema/compound-literal.c
@@ -6,15 +6,15 @@ struct foo { int a, b; };
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 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 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;
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* 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) {
- 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
OpenPOWER on IntegriCloud