diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-04-15 21:35:27 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-04-15 21:35:27 +0000 |
commit | dbb4f21125699f207ce7accfc52fdd99f47ce352 (patch) | |
tree | 9ddc8e68febb70126741a51b1bef32051b3dc037 /lib/Sema/Sema.cpp | |
parent | 68a2eb0cc76267ba0615992fb5e0977853c397b2 (diff) |
Add warning when a tentative array definition is assumed to have one element.
- Also, fixed one to actually be one (instead of zero). :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69226 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r-- | lib/Sema/Sema.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index 403e8f60f5..ed5c431da8 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -253,8 +253,9 @@ void Sema::ActOnEndOfTranslationUnit() { VD->setInvalidDecl(); else { // Set the length of the array to 1 (C99 6.9.2p5). - llvm::APSInt One(Context.getTypeSize(Context.getSizeType()), - true); + Diag(VD->getLocation(), diag::warn_tentative_incomplete_array); + llvm::APInt One(Context.getTypeSize(Context.getSizeType()), + true); QualType T = Context.getConstantArrayType(ArrayT->getElementType(), One, ArrayType::Normal, 0); |