aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-12-06 18:36:11 +0000
committerJohn McCall <rjmccall@apple.com>2010-12-06 18:36:11 +0000
commit40c2913cef2c211f1fe720ffef83fdb3e4d0fabf (patch)
treee8d0df18dd88dad02a4d1de7fea873e82e0fc37e /lib/Sema/SemaExpr.cpp
parent223ae5c26654e5fd7dacdafe43aff28a096ba63b (diff)
Do unary conversions on vararg arguments and *then* special-case float.
Fixes PR8742. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121022 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 8eed9b10e0..bc8a7527c8 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -345,12 +345,11 @@ void Sema::DefaultArgumentPromotion(Expr *&Expr) {
QualType Ty = Expr->getType();
assert(!Ty.isNull() && "DefaultArgumentPromotion - missing type");
+ UsualUnaryConversions(Expr);
+
// If this is a 'float' (CVR qualified or typedef) promote to double.
if (Ty->isSpecificBuiltinType(BuiltinType::Float))
- return ImpCastExprToType(Expr, Context.DoubleTy,
- CK_FloatingCast);
-
- UsualUnaryConversions(Expr);
+ return ImpCastExprToType(Expr, Context.DoubleTy, CK_FloatingCast);
}
/// DefaultVariadicArgumentPromotion - Like DefaultArgumentPromotion, but