Sema::FinalizeDeclaratorGroup()...make sure we emit an diagnostic for tentative definitions with incomplete types. Touch up all test cases that are effected.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46152 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/incomplete-decl.c b/test/Sema/incomplete-decl.c
new file mode 100644
index 0000000..e342ab8
--- /dev/null
+++ b/test/Sema/incomplete-decl.c
@@ -0,0 +1,15 @@
+// RUN: clang -fsyntax-only -verify %s
+
+void b; // expected-error {{variable has incomplete type 'void'}}
+struct foo f; // expected-error {{variable has incomplete type 'struct foo'}}
+
+static void c; // expected-error {{variable has incomplete type 'void'}}
+static struct foo g; // expected-error {{variable has incomplete type 'struct foo'}}
+
+extern void d;
+extern struct foo e;
+
+void func() {
+ void b; // expected-error {{variable has incomplete type 'void'}}
+ struct foo f; // expected-error {{variable has incomplete type 'struct foo'}}
+}