summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-21 17:11:58 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-21 17:11:58 +0000
commitbeecd58e21ec458d543bd5ae332d8358578d0251 (patch)
tree654a2a949dcdb3e8f42d560070b8f2035d613fd8 /clang/test
parent69223bb7f5a99de5d6acdbb5e79bf9bc2ab6faca (diff)
downloadbcm5719-llvm-beecd58e21ec458d543bd5ae332d8358578d0251.tar.gz
bcm5719-llvm-beecd58e21ec458d543bd5ae332d8358578d0251.zip
Explictly track tentative definitions within Sema, then hand those
tentative definitions off to the ASTConsumer at the end of the translation unit. Eliminate CodeGen's internal tracking of tentative definitions, and instead hook into ASTConsumer::CompleteTentativeDefinition. Also, tweak the definition-deferal logic for C++, where there are no tentative definitions. Fixes <rdar://problem/6808352>, and will make it much easier for precompiled headers to cope with tentative definitions in the future. llvm-svn: 69681
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/PCH/external-defs.h3
-rw-r--r--clang/test/Sema/init.c3
-rw-r--r--clang/test/Sema/tentative-decls.c6
3 files changed, 8 insertions, 4 deletions
diff --git a/clang/test/PCH/external-defs.h b/clang/test/PCH/external-defs.h
index 4d233e2a404..bb51a9d64b9 100644
--- a/clang/test/PCH/external-defs.h
+++ b/clang/test/PCH/external-defs.h
@@ -14,5 +14,4 @@ static int z;
int incomplete_array[];
int incomplete_array2[];
-// FIXME: CodeGen problems prevents this from working (<rdar://problem/6762287>)
-// struct S s;
+struct S s;
diff --git a/clang/test/Sema/init.c b/clang/test/Sema/init.c
index cbf75e1bb1c..7938ec5568d 100644
--- a/clang/test/Sema/init.c
+++ b/clang/test/Sema/init.c
@@ -74,8 +74,7 @@ int sym_fw1a_scr[] = {
};
// PR3001
-struct s1 s2 = { // expected-error{{tentative definition has type 'struct s1' that is never completed}} \
- // expected-note{{forward declaration of 'struct s1'}}
+struct s1 s2 = {
.a = sizeof(struct s3), // expected-error {{invalid application of 'sizeof'}} \
// expected-note{{forward declaration of 'struct s3'}}
.b = bogus // expected-error {{use of undeclared identifier 'bogus'}}
diff --git a/clang/test/Sema/tentative-decls.c b/clang/test/Sema/tentative-decls.c
index 3a830bf4283..85b5ed76bd6 100644
--- a/clang/test/Sema/tentative-decls.c
+++ b/clang/test/Sema/tentative-decls.c
@@ -57,3 +57,9 @@ void func2(void)
extern double *p;
}
+// <rdar://problem/6808352>
+static int a0[];
+static int b0;
+
+static int a0[] = { 4 };
+static int b0 = 5;
OpenPOWER on IntegriCloud