aboutsummaryrefslogtreecommitdiff
path: root/test/Sema
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2013-04-01 18:34:28 +0000
committerJohn McCall <rjmccall@apple.com>2013-04-01 18:34:28 +0000
commit5b8740f840238b3616691e5b300df57a758f32a6 (patch)
tree85a8ef951f85122637806df92dacdaaa3f1097de /test/Sema
parent88be2fdec7a1375bc729a6499629532e7872f11a (diff)
Only merge down a variable type if the previous declaration was
visible. There's a lot of potential badness in how we're modelling these things, but getting this much correct is reasonably easy. rdar://13535367 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178488 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema')
-rw-r--r--test/Sema/extern-redecl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Sema/extern-redecl.c b/test/Sema/extern-redecl.c
index ae4386eaae..9a085de0c0 100644
--- a/test/Sema/extern-redecl.c
+++ b/test/Sema/extern-redecl.c
@@ -22,3 +22,14 @@ int PR10013(void) {
static int test1_a[]; // expected-warning {{tentative array definition assumed to have one element}}
extern int test1_a[];
+
+// rdar://13535367
+void test2declarer() { extern int test2_array[100]; }
+extern int test2_array[];
+int test2v = sizeof(test2_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+
+void test3declarer() {
+ { extern int test3_array[100]; }
+ extern int test3_array[];
+ int x = sizeof(test3_array); // expected-error {{invalid application of 'sizeof' to an incomplete type 'int []'}}
+}