aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/array-constraint.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/array-constraint.c')
-rw-r--r--test/Sema/array-constraint.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/Sema/array-constraint.c b/test/Sema/array-constraint.c
index fbd4b09b40..b1095bdc19 100644
--- a/test/Sema/array-constraint.c
+++ b/test/Sema/array-constraint.c
@@ -1,4 +1,4 @@
-// RUN: clang -parse-ast-check %s
+// RUN: clang -parse-ast-check -pedantic %s
struct s;
struct s* t (struct s z[]) { // expected-error {{array has incomplete element type}}
@@ -9,3 +9,19 @@ void *k (void l[2]) { // expected-error {{array has incomplete element
return l;
}
+struct vari {
+ int a;
+ int b[];
+};
+
+struct vari *func(struct vari a[]) { // expected-error {{'struct vari' may not be used as an array element due to flexible array member}}
+ return a;
+}
+
+int foo[](void); // expected-error {{'foo' declared as array of functions}}
+
+typedef int (*pfunc)(void);
+
+pfunc xx(int f[](void)) { // expected-error {{'f' declared as array of functions}}
+ return f;
+}