From be7b7f088b806d1ea94647b4427a35dc0ef6daed Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 25 Oct 2012 10:13:58 +0000 Subject: Pull in r166498 from upstream clang trunk: Add a new warning -Wmissing-variable-declarations, to warn about variables defined without a previous declaration. This is similar to -Wmissing-prototypes, but for variables instead of functions. --- contrib/llvm/tools/clang/lib/Sema/Sema.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'contrib/llvm/tools/clang/lib/Sema/Sema.cpp') diff --git a/contrib/llvm/tools/clang/lib/Sema/Sema.cpp b/contrib/llvm/tools/clang/lib/Sema/Sema.cpp index 7f79f0c..6e2de4d 100644 --- a/contrib/llvm/tools/clang/lib/Sema/Sema.cpp +++ b/contrib/llvm/tools/clang/lib/Sema/Sema.cpp @@ -648,6 +648,8 @@ void Sema::ActOnEndOfTranslationUnit() { diag::err_tentative_def_incomplete_type)) VD->setInvalidDecl(); + CheckCompleteVariableDeclaration(VD); + // Notify the consumer that we've completed a tentative definition. if (!VD->isInvalidDecl()) Consumer.CompleteTentativeDefinition(VD); -- cgit v1.1