QualType Ty = Expr->getType();
assert(!Ty.isNull() && "DefaultArgumentPromotion - missing type");
- if (Ty == Context.FloatTy)
- ImpCastExprToType(Expr, Context.DoubleTy);
- else
- UsualUnaryConversions(Expr);
+ // If this is a 'float' (CVR qualified or typedef) promote to double.
+ if (const BuiltinType *BT = Ty->getAsBuiltinType())
+ if (BT->getKind() == BuiltinType::Float)
+ return ImpCastExprToType(Expr, Context.DoubleTy);
+
+ UsualUnaryConversions(Expr);
}
/// DefaultFunctionArrayConversion (C99 6.3.2.1p3, C99 6.3.2.1p4).
-// RUN: clang %s -emit-llvm
+// RUN: clang %s -emit-llvm -o -
// PR1895
// sizeof function
t2 = __alignof__(test4());
}
+// 'const float' promotes to double in varargs.
+int test5(const float x, float float_number) {
+ return __builtin_isless(x, float_number);
+}
+