aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-06-26 19:33:28 +0000
committerAnders Carlsson <andersca@mac.com>2009-06-26 19:33:28 +0000
commite7cf07d8df83e083505c7105c50b2797493008a6 (patch)
treeba288ffa444bba1a8501084f9f2d9fd92e991636 /lib/Sema/SemaType.cpp
parente2bb224dee15d07bc9843acd4f3ded8eb0f835ed (diff)
Can't have arrays of auto.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74314 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index b584142344..35cfce2e1f 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -498,6 +498,12 @@ QualType Sema::BuildArrayType(QualType T, ArrayType::ArraySizeModifier ASM,
return QualType();
}
+ if (Context.getCanonicalType(T) == Context.UndeducedAutoTy) {
+ Diag(Loc, diag::err_illegal_decl_array_of_auto)
+ << getPrintableNameForEntity(Entity);
+ return QualType();
+ }
+
if (const RecordType *EltTy = T->getAsRecordType()) {
// If the element type is a struct or union that contains a variadic
// array, accept it as a GNU extension: C99 6.7.2.1p2.