Teach Type::isRealType() that vector types are never real types. All

of the callers of isRealType() already assumed this, and one of them
(increment/decrement) mistakenly permitted increments of vector types
because of it.

llvm-svn: 106596
This commit is contained in:
Douglas Gregor 2010-06-22 23:13:52 +00:00
parent 49b4d73451
commit c646d13054
2 changed files with 4 additions and 2 deletions

View File

@ -585,8 +585,6 @@ bool Type::isRealType() const {
BT->getKind() <= BuiltinType::LongDouble;
if (const TagType *TT = dyn_cast<TagType>(CanonicalType))
return TT->getDecl()->isEnum() && TT->getDecl()->isDefinition();
if (const VectorType *VT = dyn_cast<VectorType>(CanonicalType))
return VT->getElementType()->isRealType();
return false;
}

View File

@ -45,3 +45,7 @@ static void test() {
}
typedef __attribute__(( ext_vector_type(2) )) float2 vecfloat2; // expected-error{{invalid vector type 'float2'}}
void inc(float2 f2) {
f2++; // expected-error{{cannot increment value of type 'float2'}}
}