summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/tentative-decls.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-10 21:58:27 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-10 21:58:27 +0000
commit8145742349fd93b7f7e5ff0cccb71e92360bea72 (patch)
tree830ccb7b8b21c271f8949cee34099d9d6e79ebd9 /clang/test/Sema/tentative-decls.c
parenta5c8e50ea6c4f7a85559540538e217e482ea695d (diff)
downloadbcm5719-llvm-8145742349fd93b7f7e5ff0cccb71e92360bea72.tar.gz
bcm5719-llvm-8145742349fd93b7f7e5ff0cccb71e92360bea72.zip
Partial fix for PR3310, concerning type-checking for tentative
definitions. We were rejecting tentative definitions of incomplete (which is bad), and now we don't. This fix is partial because we don't do the end-of-translation-unit initialization for tentative definitions that don't ever have any initializers specified. llvm-svn: 66584
Diffstat (limited to 'clang/test/Sema/tentative-decls.c')
-rw-r--r--clang/test/Sema/tentative-decls.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Sema/tentative-decls.c b/clang/test/Sema/tentative-decls.c
index 12ce181e0f1..3c1ab0e6587 100644
--- a/clang/test/Sema/tentative-decls.c
+++ b/clang/test/Sema/tentative-decls.c
@@ -1,5 +1,12 @@
// RUN: clang %s -fsyntax-only -verify
+// PR3310
+struct a x1; // expected-note 2{{forward declaration of 'struct a'}}
+static struct a x2; // expected-error{{variable has incomplete type 'struct a'}}
+struct a x3[10]; // expected-error{{array has incomplete element type 'struct a'}}
+struct a {int x;};
+struct b x4; // FIXME: error because 'struct b' is never defined
+
const int a [1] = {1};
extern const int a[];
@@ -43,3 +50,4 @@ void func2(void)
extern double *p;
extern double *p;
}
+
OpenPOWER on IntegriCloud