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 | c7ba5333782fb9643c35f94effca96c5f7526824 (patch) | |
tree | 270ef39d73cd95c319ae399ad5fe9f89f50dbc5d /clang/lib/Sema | |
parent | bc8a78d5a47f66cde93f5cae0ae19ffbaf33c6dc (diff) | |
download | bcm5719-llvm-c7ba5333782fb9643c35f94effca96c5f7526824.tar.gz bcm5719-llvm-c7ba5333782fb9643c35f94effca96c5f7526824.zip |
Add warning when a tentative array definition is assumed to have one element.
- Also, fixed one to actually be one (instead of zero). :)
llvm-svn: 69226
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 403e8f60f56..ed5c431da82 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/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); |