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
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 403e8f6..ed5c431 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -253,8 +253,9 @@
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);