Fix rdar://6881069, a crash on a form of vector_size that we
don't support. While it would be nice to support this eventually,
this form is not common at all (just seen in gcc testsuite) and
it might be better to model vector_size as a type attribute anyway.
For now just emit a nice error on it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71633 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 919f28f..6e2cc69 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -207,7 +207,8 @@
// vector arrays, and functions returning vectors.
if (CurType->isPointerType() || CurType->isArrayType() ||
CurType->isFunctionType()) {
- assert(0 && "HandleVector(): Complex type construction unimplemented");
+ S.Diag(Attr.getLoc(), diag::err_unsupported_vector_size) << CurType;
+ return;
/* FIXME: rebuild the type from the inside out, vectorizing the inner type.
do {
if (PointerType *PT = dyn_cast<PointerType>(canonType))