diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-05-13 05:13:44 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-05-13 05:13:44 +0000 |
| commit | b70f3de62542d49eb0b32e0e0505f9d3e9dd4974 (patch) | |
| tree | e21971c9dfa2c1ae4e4706d08d185fe78942cfa8 /clang/lib | |
| parent | df24298b403395da461bd89796ce6c0ee05cdb35 (diff) | |
| download | bcm5719-llvm-b70f3de62542d49eb0b32e0e0505f9d3e9dd4974.tar.gz bcm5719-llvm-b70f3de62542d49eb0b32e0e0505f9d3e9dd4974.zip | |
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.
llvm-svn: 71640
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 6e2cc699a71..711f5f937fc 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -221,8 +221,9 @@ static void HandleVectorSizeAttr(Decl *D, const AttributeList &Attr, Sema &S) { 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; } |

