diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-10-23 20:19:32 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-10-23 20:19:32 +0000 |
commit | e4851f26eb7be1f71f919bb5890da7e3583f727d (patch) | |
tree | 7caffec8839ce3c6091984f57c26b712485ef020 /lib/Sema/Sema.cpp | |
parent | 4cdad3151bfb2075c6bdbfe89fbb08f31a90a45b (diff) |
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.
Patch by Ed Schouten.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166498 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r-- | lib/Sema/Sema.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index eef5a2694a..c7d378f1ac 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -665,6 +665,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); |