summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Sema')
-rw-r--r--clang/test/Sema/array-init.c5
-rw-r--r--clang/test/Sema/decl-invalid.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/clang/test/Sema/array-init.c b/clang/test/Sema/array-init.c
index 849737e49e6..56be42c695f 100644
--- a/clang/test/Sema/array-init.c
+++ b/clang/test/Sema/array-init.c
@@ -126,8 +126,7 @@ void illegal() {
{ 6 },
},
};
- // FIXME: the following two errors are redundant
- int a[][] = { 1, 2 }; // expected-error{{array has incomplete element type 'int []'}} expected-error{{variable has incomplete type 'int []'}}
+ int a[][] = { 1, 2 }; // expected-error{{array has incomplete element type 'int []'}}
}
typedef int AryT[];
@@ -159,7 +158,7 @@ void charArrays()
char c3[5] = { "Hello" };
char c4[4] = { "Hello" }; //expected-warning{{initializer-string for char array is too long}}
- int i3[] = {}; //expected-error{{at least one initializer value required to size array}} expected-error{{variable has incomplete type 'int []'}} expected-warning{{use of GNU empty initializer extension}}
+ int i3[] = {}; //expected-error{{at least one initializer value required to size array}} expected-warning{{use of GNU empty initializer extension}}
}
void variableArrayInit() {
diff --git a/clang/test/Sema/decl-invalid.c b/clang/test/Sema/decl-invalid.c
index d241adcf2ae..281e8a8d5c0 100644
--- a/clang/test/Sema/decl-invalid.c
+++ b/clang/test/Sema/decl-invalid.c
@@ -1,3 +1,11 @@
// RUN: clang %s -fsyntax-only -verify
typedef union <anonymous> __mbstate_t; // expected-error: {{expected identifier or}}
+
+
+// PR2017
+void x();
+int a() {
+ int r[x()]; // expected-error: {{size of array has non-integer type 'void'}}
+}
+
OpenPOWER on IntegriCloud