aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaOverload.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-06-22 16:52:27 +0000
committerDouglas Gregor <dgregor@apple.com>2010-06-22 16:52:27 +0000
commit7c5b1097f5833326b4f5046d6a7d5cb7b9060145 (patch)
treedf7ed26522bee4337a2a107dc2a9fa322d67f597 /lib/Sema/SemaOverload.cpp
parent6afbdf52563942cbf3d68c1cc0fcf590c94a47d3 (diff)
Don't allow vector conversions to sneak in under the guise of
floating-point conversions or floating-integral conversions. We really, really, really need to make isFloatingType() and friends not apply to vector types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106551 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r--lib/Sema/SemaOverload.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp
index 001e951d96..a22556a7e5 100644
--- a/lib/Sema/SemaOverload.cpp
+++ b/lib/Sema/SemaOverload.cpp
@@ -1015,14 +1015,18 @@ Sema::IsStandardConversion(Expr* From, QualType ToType,
// Complex-real conversions (C99 6.3.1.7)
SCS.Second = ICK_Complex_Real;
FromType = ToType.getUnqualifiedType();
- } else if (FromType->isFloatingType() && ToType->isFloatingType()) {
+ } else if (FromType->isFloatingType() && ToType->isFloatingType() &&
+ /*FIXME*/!FromType->isVectorType() &&
+ /*FIXME*/!ToType->isVectorType()) {
// Floating point conversions (C++ 4.8).
SCS.Second = ICK_Floating_Conversion;
FromType = ToType.getUnqualifiedType();
- } else if ((FromType->isFloatingType() &&
+ } else if ((FromType->isFloatingType() &&
+ /*FIXME*/!FromType->isVectorType() &&
ToType->isIntegralType(Context) && !ToType->isBooleanType()) ||
(FromType->isIntegralOrEnumerationType() &&
- ToType->isFloatingType())) {
+ ToType->isFloatingType() &&
+ /*FIXME*/!FromType->isVectorType())) {
// Floating-integral conversions (C++ 4.9).
SCS.Second = ICK_Floating_Integral;
FromType = ToType.getUnqualifiedType();
@@ -1041,7 +1045,8 @@ Sema::IsStandardConversion(Expr* From, QualType ToType,
FromType->isAnyPointerType() ||
FromType->isBlockPointerType() ||
FromType->isMemberPointerType() ||
- FromType->isNullPtrType())) {
+ FromType->isNullPtrType()) &&
+ /*FIXME*/!FromType->isVectorType()) {
// Boolean conversions (C++ 4.12).
SCS.Second = ICK_Boolean_Conversion;
FromType = Context.BoolTy;