Add type checking for tentative definitions at the end of the
translation unit.

Thread the various declarations of variables via
VarDecl::getPreviousDeclaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66601 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/incomplete-decl.c b/test/Sema/incomplete-decl.c
index 7ec436a..de95740 100644
--- a/test/Sema/incomplete-decl.c
+++ b/test/Sema/incomplete-decl.c
@@ -1,9 +1,9 @@
 // RUN: clang -fsyntax-only -verify %s
 
-struct foo; // expected-note 3 {{forward declaration of 'struct foo'}}
+struct foo; // expected-note 4 {{forward declaration of 'struct foo'}}
 
 void b;  // expected-error {{variable has incomplete type 'void'}}
-struct foo f; // // FIXME: error because 'struct foo' is never defined
+struct foo f; // expected-error{{tentative definition has type 'struct foo' that is never completed}}
 
 static void c; // expected-error {{variable has incomplete type 'void'}}
 static struct foo g;  // expected-error {{variable has incomplete type 'struct foo'}}