[llvm-branch-commits] [cfe-branch] r71665 - in /cfe/branches/Apple/Dib: lib/Sema/SemaDeclAttr.cpp test/Sema/types.c
Mike Stump
mrs at apple.com
Wed May 13 08:31:21 PDT 2009
Author: mrs
Date: Wed May 13 10:31:18 2009
New Revision: 71665
URL: http://llvm.org/viewvc/llvm-project?rev=71665&view=rev
Log:
Merge in 71640:
Fix rdar://6880951 by rejecting vectors of vectors.
It seems dubious to me that isIntegerType() returns true for
vectors of integers, but not complex integers. This should
probably be rethought, I'll file a bugzilla.
Modified:
cfe/branches/Apple/Dib/lib/Sema/SemaDeclAttr.cpp
cfe/branches/Apple/Dib/test/Sema/types.c
Modified: cfe/branches/Apple/Dib/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/lib/Sema/SemaDeclAttr.cpp?rev=71665&r1=71664&r2=71665&view=diff
==============================================================================
--- cfe/branches/Apple/Dib/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/branches/Apple/Dib/lib/Sema/SemaDeclAttr.cpp Wed May 13 10:31:18 2009
@@ -221,8 +221,9 @@
canonType->isFunctionType());
*/
}
- // the base type must be integer or float.
- if (!CurType->isIntegerType() && !CurType->isRealFloatingType()) {
+ // the base type must be integer or float, and can't already be a vector.
+ if (CurType->isVectorType() ||
+ (!CurType->isIntegerType() && !CurType->isRealFloatingType())) {
S.Diag(Attr.getLoc(), diag::err_attribute_invalid_vector_type) << CurType;
return;
}
Modified: cfe/branches/Apple/Dib/test/Sema/types.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/Dib/test/Sema/types.c?rev=71665&r1=71664&r2=71665&view=diff
==============================================================================
--- cfe/branches/Apple/Dib/test/Sema/types.c (original)
+++ cfe/branches/Apple/Dib/test/Sema/types.c Wed May 13 10:31:18 2009
@@ -34,3 +34,6 @@
// rdar://6880104
_Decimal32 x; // expected-error {{GNU decimal type extension not supported}}
+
+// rdar://6880951
+int __attribute__ ((vector_size (8), vector_size (8))) v; // expected-error {{invalid vector type}}
More information about the llvm-branch-commits
mailing list