aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/array-constraint.c
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2007-08-26 14:38:38 +0000
committerSteve Naroff <snaroff@apple.com>2007-08-26 14:38:38 +0000
commit26b8ff45bab784183018f79ec95327aac4e7e8b0 (patch)
treee4fcf8d0c73c1b6ba11a153731dd12c9edc18074 /test/Sema/array-constraint.c
parent8b2f3b72c068b360fea8342a7fc7b56fb218682a (diff)
Fix bogus warnings (noticed by Chris) with array-constraints.c.
Remove bogus type conversions in Sema::GetTypeForDeclarator(). This commit only deals with the array types (DeclaratorCheck::Array), though the rest of this routine should be reviewed. Given the complexity of C declarators, I don't want to change the entire routine now (will discuss with Chris tomorrow). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41443 91177308-0d34-0410-b5e6-96231b3b80d8
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;
+}