diff options
author | Anders Carlsson <andersca@mac.com> | 2009-06-26 19:33:28 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-06-26 19:33:28 +0000 |
commit | e7cf07d8df83e083505c7105c50b2797493008a6 (patch) | |
tree | ba288ffa444bba1a8501084f9f2d9fd92e991636 /lib/Sema/SemaType.cpp | |
parent | e2bb224dee15d07bc9843acd4f3ded8eb0f835ed (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.cpp | 6 |
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. |